/**
 * function (e){ //code }  这是一个匿名函数；所谓的匿名函数是指它没有自己的名字  匿名函数自执行 
 */
(function(e) {
	if(typeof(define)!= "undefined" && define.amd){
		define(["exports"], e) 
	}else{
		e(window.bkgraph = {})
	}
})
(function(e) {
    var t, n, r;
    (function(e) {
        function d(e, t) {
            return h.call(e, t)
        }
        function v(e, t) {
            var n, r, i, s, o, u, a, f, c, h, p = t && t.split("/"),
            d = l.map,
            v = d && d["*"] || {};
            if (e && e.charAt(0) === ".") if (t) {
                p = p.slice(0, p.length - 1),
                e = p.concat(e.split("/"));
                for (f = 0; f < e.length; f += 1) {
                    h = e[f];
                    if (h === ".") e.splice(f, 1),
                    f -= 1;
                    else if (h === "..") {
                        if (f === 1 && (e[2] === ".." || e[0] === "..")) break;
                        f > 0 && (e.splice(f - 1, 2), f -= 2)
                    }
                }
                e = e.join("/")
            } else {
            	e.indexOf("./") === 0 && (e = e.substring(2));
            }
            if ((p || v) && d) {
                n = e.split("/");
                for (f = n.length; f > 0; f -= 1) {
                    r = n.slice(0, f).join("/");
                    if (p) for (c = p.length; c > 0; c -= 1) {
                        i = d[p.slice(0, c).join("/")];
                        if (i) {
                            i = i[r];
                            if (i) {
                                s = i,
                                o = f;
                                break
                            }
                        }
                    }
                    if (s) break; ! u && v && v[r] && (u = v[r], a = f)
                } ! s && u && (s = u, o = a),
                s && (n.splice(0, o, s), e = n.join("/"))
            }
            return e
        }
        function m(t, n) {
            return function() {
                return s.apply(e, p.call(arguments, 0).concat([t, n]))
            }
        }
        function g(e) {
            return function(t) {
                return v(t, e)
            }
        }
        function y(e) {
            return function(t) {
                a[e] = t
            }
        }
        function b(t) {
            if (d(f, t)) {
                var n = f[t];
                delete f[t],
                c[t] = !0,
                i.apply(e, n)
            }
            if (!d(a, t) && !d(c, t)) throw new Error("No " + t);
            return a[t]
        }
        function w(e) {
            var t, n = e ? e.indexOf("!") : -1;
            return n > -1 && (t = e.substring(0, n), e = e.substring(n + 1, e.length)),
            [t, e]
        }
        function E(e) {
            return function() {
                return l && l.config && l.config[e] || {}
            }
        }
        var i, s, o, u, a = {},
        f = {},
        l = {},
        c = {},
        h = Object.prototype.hasOwnProperty,
        p = [].slice;
        o = function(e, t) {
            var n, r = w(e),
            i = r[0];
            return e = r[1],
            i && (i = v(i, t), n = b(i)),
            i ? n && n.normalize ? e = n.normalize(e, g(t)) : e = v(e, t) : (e = v(e, t), r = w(e), i = r[0], e = r[1], i && (n = b(i))),
            {
                f: i ? i + "!" + e: e,
                n: e,
                pr: i,
                p: n
            }
        },
        u = {
            require: function(e) {
                return m(e)
            },
            exports: function(e) {
                var t = a[e];
                return typeof t != "undefined" ? t: a[e] = {}
            },
            module: function(e) {
                return {
                    id: e,
                    uri: "",
                    exports: a[e],
                    config: E(e)
                }
            }
        },
        i = function(t, n, r, i) {
            var s, l, h, p, v, g = [],
            w;
            i = i || t;
            if (typeof r == "function") {
                n = !n.length && r.length ? ["require", "exports", "module"] : n;
                for (v = 0; v < n.length; v += 1) {
                    p = o(n[v], i),
                    l = p.f;
                    if (l === "require") g[v] = u.require(t);
                    else if (l === "exports") g[v] = u.exports(t),
                    w = !0;
                    else if (l === "module") s = g[v] = u.module(t);
                    else if (d(a, l) || d(f, l) || d(c, l)) g[v] = b(l);
                    else {
                        if (!p.p) throw new Error(t + " missing " + l);
                        p.p.load(p.n, m(i, !0), y(l), {}),
                        g[v] = a[l]
                    }
                }
                h = r.apply(a[t], g);
                if (t) if (s && s.exports !== e && s.exports !== a[t]) a[t] = s.exports;
                else if (h !== e || !w) a[t] = h
            } else t && (a[t] = r)
        },
        t = n = s = function(t, n, r, a, f) {
        	if(typeof(t) == "string"){
        		if(u[t]){
        			return u[t](n);
        		}else{
        			return b(o(t, n).f);
        		}
        	}else{
        		return (t.splice || (l = t, n.splice ? (t = n, n = r, r = null) : t = e), 
    	    		n = n ||
    	            function() {},
    	            typeof r == "function" && (r = a, a = f), a ? i(e, t, n, r) : setTimeout(function() {
    	                i(e, t, n, r)
    	            },
    	            4), s)
        	}
        },
        s.config = function(e) {
            return l = e,
            l.deps && s(l.deps, l.callback),
            s
        },
        /*yyh r*/
        r = function(e, t, n) {
            t.splice || (n = t, t = []),
            !d(a, e) && !d(f, e) && (f[e] = [e, t, n])
        },
        r.amd = {
            jQuery: !0
        }
    })(),
    r("text", {load: function(e) {
            throw new Error("Dynamic load not allowed: " + e)
        }
    }),
    /*IE浏览器*/
    r("zrender/dep/excanvas", ["require"],function(e) {
        return document.createElement("canvas").getContext ? G_vmlCanvasManager = !1 : function() {
            function f() {
                return this.context_ || (this.context_ = new R(this))
            }
            function c(e, t, n) {
                var r = l.call(arguments, 2);
                return function() {
                    return e.apply(t, r.concat(l.call(arguments)))
                }
            }
            function h(e) {
                return String(e).replace(/&/g, "&amp;").replace(/"/g, "&quot;")
            }
            function p(e, t, n) {
                e.namespaces[t] || e.namespaces.add(t, n, "#default#VML")
            }
            function d(e) {
                p(e, "g_vml_", "urn:schemas-microsoft-com:vml"),
                p(e, "g_o_", "urn:schemas-microsoft-com:office:office");
                if (!e.styleSheets.ex_canvas_) {
                    var t = e.createStyleSheet();
                    t.owningElement.id = "ex_canvas_",
                    t.cssText = "canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"
                }
            }
            function m(e) {
                var t = e.srcElement;
                switch (e.propertyName) {
                case "width":
                    t.getContext().clearRect(),
                    t.style.width = t.attributes.width.nodeValue + "px",
                    t.firstChild.style.width = t.clientWidth + "px";
                    break;
                case "height":
                    t.getContext().clearRect(),
                    t.style.height = t.attributes.height.nodeValue + "px",
                    t.firstChild.style.height = t.clientHeight + "px"
                }
            }
            function g(e) {
                var t = e.srcElement;
                t.firstChild && (t.firstChild.style.width = t.clientWidth + "px", t.firstChild.style.height = t.clientHeight + "px")
            }
            function E() {
                return [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
            }
            function S(e, t) {
                var n = E();
                for (var r = 0; r < 3; r++) for (var i = 0; i < 3; i++) {
                    var s = 0;
                    for (var o = 0; o < 3; o++) s += e[r][o] * t[o][i];
                    n[r][i] = s
                }
                return n
            }
            function x(e, t, n) {
                var r = e.m_;
                return {
                    x: o * (t * r[0][0] + n * r[1][0] + r[2][0]) - u,
                    y: o * (t * r[0][1] + n * r[1][1] + r[2][1]) - u
                }
            }
            function T(e, t, n) {
                var r = e.m_;
                return {
                    x: o * (t * r[0][0] + n * r[1][0]) - u,
                    y: o * (t * r[0][1] + n * r[1][1]) - u
                }
            }
            function N(e, t) {
                t.fillStyle = e.fillStyle,
                t.lineCap = e.lineCap,
                t.lineJoin = e.lineJoin,
                t.lineWidth = e.lineWidth,
                t.miterLimit = e.miterLimit,
                t.shadowBlur = e.shadowBlur,
                t.shadowColor = e.shadowColor,
                t.shadowOffsetX = e.shadowOffsetX,
                t.shadowOffsetY = e.shadowOffsetY,
                t.strokeStyle = e.strokeStyle,
                t.globalAlpha = e.globalAlpha,
                t.font = e.font,
                t.textAlign = e.textAlign,
                t.textBaseline = e.textBaseline,
                t.scaleX_ = e.scaleX_,
                t.scaleY_ = e.scaleY_,
                t.x_ = e.x_,
                t.y_ = e.y_,
                t.lineScale_ = e.lineScale_
            }
            function k(e) {
                var t = e.indexOf("(", 3),
                n = e.indexOf(")", t + 1),
                r = e.substring(t + 1, n).split(",");
                if (r.length != 4 || e.charAt(3) != "a") r[3] = 1;
                return r
            }
            function L(e) {
                return parseFloat(e) / 100
            }
            function A(e, t, n) {
                return Math.min(n, Math.max(t, e))
            }
            function O(e) {
                var t, n, r, i, s, o;
                i = parseFloat(e[0]) / 360 % 360,
                i < 0 && i++,
                s = A(L(e[1]), 0, 1),
                o = A(L(e[2]), 0, 1);
                if (s == 0) t = n = r = o;
                else {
                    var u = o < .5 ? o * (1 + s) : o + s - o * s,
                    a = 2 * o - u;
                    t = M(a, u, i + 1 / 3),
                    n = M(a, u, i),
                    r = M(a, u, i - 1 / 3)
                }
                return "#" + y[Math.floor(t * 255)] + y[Math.floor(n * 255)] + y[Math.floor(r * 255)]
            }
            function M(e, t, n) {
                return n < 0 && n++,
                n > 1 && n--,
                6 * n < 1 ? e + (t - e) * 6 * n: 2 * n < 1 ? t: 3 * n < 2 ? e + (t - e) * (2 / 3 - n) * 6 : e
            }
            function D(e) {
                if (e in _) return _[e];
                var t, n = 1;
                e = String(e);
                if (e.charAt(0) == "#") t = e;
                else if (/^rgb/.test(e)) {
                    var r = k(e),
                    t = "#",
                    i;
                    for (var s = 0; s < 3; s++) r[s].indexOf("%") != -1 ? i = Math.floor(L(r[s]) * 255) : i = +r[s],
                    t += y[A(i, 0, 255)];
                    n = +r[3]
                } else if (/^hsl/.test(e)) {
                    var r = k(e);
                    t = O(r),
                    n = r[3]
                } else t = C[e] || e;
                return _[e] = {
                    color: t,
                    alpha: n
                }
            }
            function B(e) {
                if (H[e]) return H[e];
                var t = document.createElement("div"),
                n = t.style,
                r;
                try {
                    n.font = e,
                    r = n.fontFamily.split(",")[0]
                } catch(i) {}
                return H[e] = {
                    style: n.fontStyle || P.style,
                    variant: n.fontVariant || P.variant,
                    weight: n.fontWeight || P.weight,
                    size: n.fontSize || P.size,
                    family: r || P.family
                }
            }
            function j(e, t) {
                var n = {};
                for (var r in e) n[r] = e[r];
                var i = parseFloat(t.currentStyle.fontSize),
                s = parseFloat(e.size);
                return typeof e.size == "number" ? n.size = e.size: e.size.indexOf("px") != -1 ? n.size = s: e.size.indexOf("em") != -1 ? n.size = i * s: e.size.indexOf("%") != -1 ? n.size = i / 100 * s: e.size.indexOf("pt") != -1 ? n.size = s / .75 : n.size = i,
                n
            }
            function F(e) {
                return e.style + " " + e.variant + " " + e.weight + " " + e.size + "px '" + e.family + "'"
            }
            function q(e) {
                return I[e] || "square"
            }
            function R(e) {
                this.m_ = E(),
                this.mStack_ = [],
                this.aStack_ = [],
                this.currentPath_ = [],
                this.strokeStyle = "#000",
                this.fillStyle = "#000",
                this.lineWidth = 1,
                this.lineJoin = "miter",
                this.lineCap = "butt",
                this.miterLimit = o * 1,
                this.globalAlpha = 1,
                this.font = "12px 宋体",
                this.textAlign = "left",
                this.textBaseline = "alphabetic",
                this.canvas = e;
                var t = "width:" + e.clientWidth + "px;height:" + e.clientHeight + "px;overflow:hidden;position:absolute",
                n = e.ownerDocument.createElement("div");
                n.style.cssText = t,
                e.appendChild(n);
                var r = n.cloneNode(!1);
                r.style.backgroundColor = "#fff",
                r.style.filter = "alpha(opacity=0)",
                e.appendChild(r),
                this.element_ = n,
                this.scaleX_ = 1,
                this.scaleY_ = 1,
                this.x_ = 0,
                this.y_ = 0,
                this.lineScale_ = 1,
                this.html_ = ""
            }
            function z(e, t, n, r) {
                e.currentPath_.push({
                    type: "bezierCurveTo",
                    cp1x: t.x,
                    cp1y: t.y,
                    cp2x: n.x,
                    cp2y: n.y,
                    x: r.x,
                    y: r.y
                }),
                e.currentX_ = r.x,
                e.currentY_ = r.y
            }
            function W(e, t) {
                var n = D(e.strokeStyle),
                r = n.color,
                i = n.alpha * e.globalAlpha,
                s = e.lineScale_ * e.lineWidth;
                s < 1 && (i *= s),
                t.push("<g_vml_:stroke", ' opacity="', i, '"', ' joinstyle="', e.lineJoin, '"', ' miterlimit="', e.miterLimit, '"', ' endcap="', q(e.lineCap), '"', ' weight="', s, 'px"', ' color="', r, '" />')
            }
            function X(t, n, r, i) {
                var s = t.fillStyle,
                u = t.scaleX_,
                a = t.scaleY_,
                f = i.x - r.x,
                l = i.y - r.y;
                if (s instanceof J) {
                    var c = 0,
                    h = {
                        x: 0,
                        y: 0
                    },
                    p = 0,
                    d = 1;
                    if (s.type_ == "gradient") {
                        var v = s.x0_ / u,
                        m = s.y0_ / a,
                        g = s.x1_ / u,
                        y = s.y1_ / a,
                        b = x(t, v, m),
                        w = x(t, g, y),
                        E = w.x - b.x,
                        S = w.y - b.y;
                        c = Math.atan2(E, S) * 180 / Math.PI,
                        c < 0 && (c += 360),
                        c < 1e-6 && (c = 0)
                    } else {
                        var b = x(t, s.x0_, s.y0_);
                        h = {
                            x: (b.x - r.x) / f,
                            y: (b.y - r.y) / l
                        },
                        f /= u * o,
                        l /= a * o;
                        var T = e.max(f, l);
                        p = 2 * s.r0_ / T,
                        d = 2 * s.r1_ / T - p
                    }
                    var N = s.colors_;
                    N.sort(function(e, t) {
                        return e.offset - t.offset
                    });
                    var C = N.length,
                    k = N[0].color,
                    L = N[C - 1].color,
                    A = N[0].alpha * t.globalAlpha,
                    O = N[C - 1].alpha * t.globalAlpha,
                    M = [];
                    for (var _ = 0; _ < C; _++) {
                        var P = N[_];
                        M.push(P.offset * d + p + " " + P.color)
                    }
                    n.push('<g_vml_:fill type="', s.type_, '"', ' method="none" focus="100%"', ' color="', k, '"', ' color2="', L, '"', ' colors="', M.join(","), '"', ' opacity="', O, '"', ' g_o_:opacity2="', A, '"', ' angle="', c, '"', ' focusposition="', h.x, ",", h.y, '" />')
                } else if (s instanceof K) {
                    if (f && l) {
                        var H = -r.x,
                        B = -r.y;
                        n.push("<g_vml_:fill", ' position="', H / f * u * u, ",", B / l * a * a, '"', ' type="tile"', ' src="', s.src_, '" />')
                    }
                } else {
                    var j = D(t.fillStyle),
                    F = j.color,
                    I = j.alpha * t.globalAlpha;
                    n.push('<g_vml_:fill color="', F, '" opacity="', I, '" />')
                }
            }
            function V(e) {
                return isFinite(e[0][0]) && isFinite(e[0][1]) && isFinite(e[1][0]) && isFinite(e[1][1]) && isFinite(e[2][0]) && isFinite(e[2][1])
            }
            function $(e, t, n) {
                if (!V(t)) return;
                e.m_ = t,
                e.scaleX_ = Math.sqrt(t[0][0] * t[0][0] + t[0][1] * t[0][1]),
                e.scaleY_ = Math.sqrt(t[1][0] * t[1][0] + t[1][1] * t[1][1]),
                e.x_ = t[2][0],
                e.y_ = t[2][1];
                if (n) {
                    var r = t[0][0] * t[1][1] - t[0][1] * t[1][0];
                    e.lineScale_ = s(i(r))
                }
            }
            function J(e) {
                this.type_ = e,
                this.x0_ = 0,
                this.y0_ = 0,
                this.r0_ = 0,
                this.x1_ = 0,
                this.y1_ = 0,
                this.r1_ = 0,
                this.colors_ = []
            }
            function K(e, t) {
                G(e);
                switch (t) {
                case "repeat":
                case null:
                case "":
                    this.repetition_ = "repeat";
                    break;
                case "repeat-x":
                case "repeat-y":
                case "no-repeat":
                    this.repetition_ = t;
                    break;
                default:
                    Q("SYNTAX_ERR")
                }
                this.src_ = e.src,
                this.width_ = e.width,
                this.height_ = e.height
            }
            function Q(e) {
                throw new Y(e)
            }
            function G(e) { (!e || e.nodeType != 1 || e.tagName != "IMG") && Q("TYPE_MISMATCH_ERR"),
                e.readyState != "complete" && Q("INVALID_STATE_ERR")
            }
            function Y(e) {
                this.code = this[e],
                this.message = e + ": DOM Exception " + this.code
            }
            var e = Math,
            t = e.round,
            n = e.sin,
            r = e.cos,
            i = e.abs,
            s = e.sqrt,
            o = 10,
            u = o / 2,
            a = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],
            l = Array.prototype.slice;
            d(document);
            var v = {
                init: function(e) {
                    var t = e || document;
                    t.createElement("canvas"),
                    t.attachEvent("onreadystatechange", c(this.init_, this, t))
                },
                init_: function(e) {
                    var t = e.getElementsByTagName("canvas");
                    for (var n = 0; n < t.length; n++) this.initElement(t[n])
                },
                initElement: function(e) {
                    if (!e.getContext) {
                        e.getContext = f,
                        d(e.ownerDocument),
                        e.innerHTML = "",
                        e.attachEvent("onpropertychange", m),
                        e.attachEvent("onresize", g);
                        var t = e.attributes;
                        t.width && t.width.specified ? e.style.width = t.width.nodeValue + "px": e.width = e.clientWidth,
                        t.height && t.height.specified ? e.style.height = t.height.nodeValue + "px": e.height = e.clientHeight
                    }
                    return e
                }
            };
            v.init();
            var y = [];
            for (var b = 0; b < 16; b++) for (var w = 0; w < 16; w++) y[b * 16 + w] = b.toString(16) + w.toString(16);
            var C = {
                aliceblue: "#F0F8FF",
                antiquewhite: "#FAEBD7",
                aquamarine: "#7FFFD4",
                azure: "#F0FFFF",
                beige: "#F5F5DC",
                bisque: "#FFE4C4",
                black: "#000000",
                blanchedalmond: "#FFEBCD",
                blueviolet: "#8A2BE2",
                brown: "#A52A2A",
                burlywood: "#DEB887",
                cadetblue: "#5F9EA0",
                chartreuse: "#7FFF00",
                chocolate: "#D2691E",
                coral: "#FF7F50",
                cornflowerblue: "#6495ED",
                cornsilk: "#FFF8DC",
                crimson: "#DC143C",
                cyan: "#00FFFF",
                darkblue: "#00008B",
                darkcyan: "#008B8B",
                darkgoldenrod: "#B8860B",
                darkgray: "#A9A9A9",
                darkgreen: "#006400",
                darkgrey: "#A9A9A9",
                darkkhaki: "#BDB76B",
                darkmagenta: "#8B008B",
                darkolivegreen: "#556B2F",
                darkorange: "#FF8C00",
                darkorchid: "#9932CC",
                darkred: "#8B0000",
                darksalmon: "#E9967A",
                darkseagreen: "#8FBC8F",
                darkslateblue: "#483D8B",
                darkslategray: "#2F4F4F",
                darkslategrey: "#2F4F4F",
                darkturquoise: "#00CED1",
                darkviolet: "#9400D3",
                deeppink: "#FF1493",
                deepskyblue: "#00BFFF",
                dimgray: "#696969",
                dimgrey: "#696969",
                dodgerblue: "#1E90FF",
                firebrick: "#B22222",
                floralwhite: "#FFFAF0",
                forestgreen: "#228B22",
                gainsboro: "#DCDCDC",
                ghostwhite: "#F8F8FF",
                gold: "#FFD700",
                goldenrod: "#DAA520",
                grey: "#808080",
                greenyellow: "#ADFF2F",
                honeydew: "#F0FFF0",
                hotpink: "#FF69B4",
                indianred: "#CD5C5C",
                indigo: "#4B0082",
                ivory: "#FFFFF0",
                khaki: "#F0E68C",
                lavender: "#E6E6FA",
                lavenderblush: "#FFF0F5",
                lawngreen: "#7CFC00",
                lemonchiffon: "#FFFACD",
                lightblue: "#ADD8E6",
                lightcoral: "#F08080",
                lightcyan: "#E0FFFF",
                lightgoldenrodyellow: "#FAFAD2",
                lightgreen: "#90EE90",
                lightgrey: "#D3D3D3",
                lightpink: "#FFB6C1",
                lightsalmon: "#FFA07A",
                lightseagreen: "#20B2AA",
                lightskyblue: "#87CEFA",
                lightslategray: "#778899",
                lightslategrey: "#778899",
                lightsteelblue: "#B0C4DE",
                lightyellow: "#FFFFE0",
                limegreen: "#32CD32",
                linen: "#FAF0E6",
                magenta: "#FF00FF",
                mediumaquamarine: "#66CDAA",
                mediumblue: "#0000CD",
                mediumorchid: "#BA55D3",
                mediumpurple: "#9370DB",
                mediumseagreen: "#3CB371",
                mediumslateblue: "#7B68EE",
                mediumspringgreen: "#00FA9A",
                mediumturquoise: "#48D1CC",
                mediumvioletred: "#C71585",
                midnightblue: "#191970",
                mintcream: "#F5FFFA",
                mistyrose: "#FFE4E1",
                moccasin: "#FFE4B5",
                navajowhite: "#FFDEAD",
                oldlace: "#FDF5E6",
                olivedrab: "#6B8E23",
                orange: "#FFA500",
                orangered: "#FF4500",
                orchid: "#DA70D6",
                palegoldenrod: "#EEE8AA",
                palegreen: "#98FB98",
                paleturquoise: "#AFEEEE",
                palevioletred: "#DB7093",
                papayawhip: "#FFEFD5",
                peachpuff: "#FFDAB9",
                peru: "#CD853F",
                pink: "#FFC0CB",
                plum: "#DDA0DD",
                powderblue: "#B0E0E6",
                rosybrown: "#BC8F8F",
                royalblue: "#4169E1",
                saddlebrown: "#8B4513",
                salmon: "#FA8072",
                sandybrown: "#F4A460",
                seagreen: "#2E8B57",
                seashell: "#FFF5EE",
                sienna: "#A0522D",
                skyblue: "#87CEEB",
                slateblue: "#6A5ACD",
                slategray: "#708090",
                slategrey: "#708090",
                snow: "#FFFAFA",
                springgreen: "#00FF7F",
                steelblue: "#4682B4",
                tan: "#D2B48C",
                thistle: "#D8BFD8",
                tomato: "#FF6347",
                turquoise: "#40E0D0",
                violet: "#EE82EE",
                wheat: "#F5DEB3",
                whitesmoke: "#F5F5F5",
                yellowgreen: "#9ACD32"
            },
            _ = {},
            P = {
                style: "normal",
                variant: "normal",
                weight: "normal",
                size: 12,
                family: "宋体"
            },
            H = {},
            I = {
                butt: "flat",
                round: "round"
            },
            U = R.prototype;
            U.clearRect = function() {
                this.textMeasureEl_ && (this.textMeasureEl_.removeNode(!0), this.textMeasureEl_ = null),
                this.element_.innerHTML = ""
            },
            U.flush = function() {
                this.element_.insertAdjacentHTML("beforeEnd", this.html_),
                this.html_ = ""
            },
            U.beginPath = function() {
                this.currentPath_ = []
            },
            U.moveTo = function(e, t) {
                var n = T(this, e, t);
                n.type = "moveTo",
                this.currentPath_.push(n),
                this.currentX_ = n.x,
                this.currentY_ = n.y
            },
            U.lineTo = function(e, t) {
                var n = T(this, e, t);
                n.type = "lineTo",
                this.currentPath_.push(n),
                this.currentX_ = n.x,
                this.currentY_ = n.y
            },
            U.bezierCurveTo = function(e, t, n, r, i, s) {
                var o = T(this, i, s),
                u = T(this, e, t),
                a = T(this, n, r);
                z(this, u, a, o)
            },
            U.quadraticCurveTo = function(e, t, n, r) {
                var i = T(this, e, t),
                s = T(this, n, r),
                o = {
                    x: this.currentX_ + 2 / 3 * (i.x - this.currentX_),
                    y: this.currentY_ + 2 / 3 * (i.y - this.currentY_)
                },
                u = {
                    x: o.x + (s.x - this.currentX_) / 3,
                    y: o.y + (s.y - this.currentY_) / 3
                };
                z(this, o, u, s)
            },
            U.arc = function(e, t, i, s, a, f) {
                i *= o;
                var l = f ? "at": "wa",
                c = e + r(s) * i - u,
                h = t + n(s) * i - u,
                p = e + r(a) * i - u,
                d = t + n(a) * i - u;
                c == p && !f && (c += .125);
                var v = T(this, e, t),
                m = T(this, c, h),
                g = T(this, p, d);
                this.currentPath_.push({
                    type: l,
                    x: v.x,
                    y: v.y,
                    radius: i,
                    xStart: m.x,
                    yStart: m.y,
                    xEnd: g.x,
                    yEnd: g.y
                })
            },
            U.rect = function(e, t, n, r) {
                this.moveTo(e, t),
                this.lineTo(e + n, t),
                this.lineTo(e + n, t + r),
                this.lineTo(e, t + r),
                this.closePath()
            },
            U.strokeRect = function(e, t, n, r) {
                var i = this.currentPath_;
                this.beginPath(),
                this.moveTo(e, t),
                this.lineTo(e + n, t),
                this.lineTo(e + n, t + r),
                this.lineTo(e, t + r),
                this.closePath(),
                this.stroke(),
                this.currentPath_ = i
            },
            U.fillRect = function(e, t, n, r) {
                var i = this.currentPath_;
                this.beginPath(),
                this.moveTo(e, t),
                this.lineTo(e + n, t),
                this.lineTo(e + n, t + r),
                this.lineTo(e, t + r),
                this.closePath(),
                this.fill(),
                this.currentPath_ = i
            },
            U.createLinearGradient = function(e, t, n, r) {
                var i = new J("gradient");
                return i.x0_ = e,
                i.y0_ = t,
                i.x1_ = n,
                i.y1_ = r,
                i
            },
            U.createRadialGradient = function(e, t, n, r, i, s) {
                var o = new J("gradientradial");
                return o.x0_ = e,
                o.y0_ = t,
                o.r0_ = n,
                o.x1_ = r,
                o.y1_ = i,
                o.r1_ = s,
                o
            },
            U.drawImage = function(n, r) {
                var i, s, u, a, f, l, c, h, p = n.runtimeStyle.width,
                d = n.runtimeStyle.height;
                n.runtimeStyle.width = "auto",
                n.runtimeStyle.height = "auto";
                var v = n.width,
                m = n.height,
                g = this.m_;
                n.runtimeStyle.width = p,
                n.runtimeStyle.height = d;
                if (arguments.length == 3) i = arguments[1],
                s = arguments[2],
                f = l = 0,
                c = u = v,
                h = a = m;
                else if (arguments.length == 5) i = arguments[1],
                s = arguments[2],
                u = arguments[3],
                a = arguments[4],
                f = l = 0,
                c = v,
                h = m;
                else {
                    if (arguments.length != 9) throw Error("Invalid number of arguments");
                    f = arguments[1],
                    l = arguments[2],
                    c = arguments[3],
                    h = arguments[4],
                    i = arguments[5],
                    s = arguments[6],
                    u = arguments[7],
                    a = arguments[8]
                }
                var y = c / 2,
                b = h / 2,
                w = [],
                E = 10,
                S = 10,
                T = g[1] || g[2],
                N = f || l,
                C = this.scaleX_,
                k = this.scaleY_,
                L = this.x_ + i * C,
                A = this.y_ + s * k;
                if (!T || !N) w.push('<img src="', n.src, '"', 'style="position:absolute;left:', L, "px;top:", A, "px;"),
                w.push("width:", C * u / c * v, "px;height:", k * a / h * m, "px;"),
                this.globalAlpha < 1 && w.push("filter:alpha(opacity=", t(this.globalAlpha * 100) + ")"),
                w.push('" />');
                else if (T) {
                    w.push(" <g_vml_:group", ' coordsize="', o * E, ",", o * S, '"', ' coordorigin="0,0"', ' style="width:', E, "px;height:", S, "px;position:absolute;");
                    var O = x(this, i, s),
                    M = [];
                    M.push("M11=", this.m_[0][0] / C, ",", "M12=", this.m_[1][0] / k, ",", "M21=", this.m_[0][1] / C, ",", "M22=", this.m_[1][1] / k, ",", "Dx=", t(O.x / o), ",", "Dy=", t(O.y / o), "");
                    var _ = O,
                    D = x(this, i + u, s),
                    P = x(this, i, s + a),
                    H = x(this, i + u, s + a);
                    _.x = e.max(_.x, D.x, P.x, H.x),
                    _.y = e.max(_.y, D.y, P.y, H.y),
                    w.push("padding:0 ", t(_.x / o), "px ", t(_.y / o), "px 0;filter:progid:DXImageTransform.Microsoft.Matrix(", M.join(""), ", SizingMethod='clip');>"),
                    N && w.push('<div style="overflow: hidden; width:', Math.ceil((u + f * u / c) * C), "px;", " height:", Math.ceil((a + l * a / h) * k), "px;", " filter:progid:DxImageTransform.Microsoft.Matrix(Dx=", -f * u / c * C, ",Dy=", -l * a / h * k, ');">'),
                    w.push('<img src="', n.src, '"', 'style="position:absolute;'),
                    w.push("width:", C * u / c * v, "px;height:", k * a / h * m, "px;"),
                    this.globalAlpha < 1 && w.push("filter:alpha(opacity=", t(this.globalAlpha * 100) + ")"),
                    w.push('" />'),
                    N && w.push("</div>"),
                    w.push("</g_vml_:group>")
                } else w.push('<div style="overflow: hidden; width:', Math.ceil((u + f * u / c) * C), "px;", " height:", Math.ceil((a + l * a / h) * k), "px;", "position:absolute;left:", L, "px;", "top:", A, "px;", " filter:progid:DxImageTransform.Microsoft.Matrix(Dx=", -f * u / c * C, ",Dy=", -l * a / h * k, ');">'),
                w.push('<img src="', n.src, '"', 'style="position:absolute;'),
                w.push("width:", C * u / c * v, "px;height:", k * a / h * m, "px;"),
                this.globalAlpha < 1 && w.push("filter:alpha(opacity=", t(this.globalAlpha * 100) + ")"),
                w.push('" /></div>');
                this.html_ += w.join("")
            },
            U.stroke = function(e) {
                var n = [],
                r = !1,
                i = 10,
                s = 10,
                u = this.x_,
                a = this.y_;
                n.push("<g_vml_:shape", ' filled="', !!e, '"', ' style="position:absolute;width:', i, "px;height:", s, "px;", "left:", u, "px;top:", a, 'px;"', ' coordorigin="0,0"', ' coordsize="', o * i, ",", o * s, '"', ' stroked="', !e, '"', ' path="');
                var f = !1,
                l = {
                    x: null,
                    y: null
                },
                c = {
                    x: null,
                    y: null
                };
                for (var h = 0; h < this.currentPath_.length; h++) {
                    var p = this.currentPath_[h],
                    d;
                    switch (p.type) {
                    case "moveTo":
                        d = p,
                        n.push(" m ", t(p.x), ",", t(p.y));
                        break;
                    case "lineTo":
                        n.push(" l ", t(p.x), ",", t(p.y));
                        break;
                    case "close":
                        n.push(" x "),
                        p = null;
                        break;
                    case "bezierCurveTo":
                        n.push(" c ", t(p.cp1x), ",", t(p.cp1y), ",", t(p.cp2x), ",", t(p.cp2y), ",", t(p.x), ",", t(p.y));
                        break;
                    case "at":
                    case "wa":
                        n.push(" ", p.type, " ", t(p.x - this.scaleX_ * p.radius), ",", t(p.y - this.scaleY_ * p.radius), " ", t(p.x + this.scaleX_ * p.radius), ",", t(p.y + this.scaleY_ * p.radius), " ", t(p.xStart), ",", t(p.yStart), " ", t(p.xEnd), ",", t(p.yEnd))
                    }
                    if (p) {
                        if (l.x == null || p.x < l.x) l.x = p.x;
                        if (c.x == null || p.x > c.x) c.x = p.x;
                        if (l.y == null || p.y < l.y) l.y = p.y;
                        if (c.y == null || p.y > c.y) c.y = p.y
                    }
                }
                n.push(' ">'),
                e ? X(this, n, l, c) : W(this, n),
                n.push("</g_vml_:shape>"),
                this.html_ += n.join("")
            },
            U.fill = function() {
                this.stroke(!0)
            },
            U.closePath = function() {
                this.currentPath_.push({
                    type: "close"
                })
            },
            U.save = function() {
                var e = {};
                N(this, e),
                this.aStack_.push(e),
                this.mStack_.push(this.m_),
                this.m_ = S(E(), this.m_)
            },
            U.restore = function() {
                this.aStack_.length && (N(this.aStack_.pop(), this), this.m_ = this.mStack_.pop())
            },
            U.translate = function(e, t) {
                var n = [[1, 0, 0], [0, 1, 0], [e, t, 1]];
                $(this, S(n, this.m_), !1)
            },
            U.rotate = function(e) {
                var t = r(e),
                i = n(e),
                s = [[t, i, 0], [ - i, t, 0], [0, 0, 1]];
                $(this, S(s, this.m_), !1)
            },
            U.scale = function(e, t) {
                var n = [[e, 0, 0], [0, t, 0], [0, 0, 1]];
                $(this, S(n, this.m_), !0)
            },
            U.transform = function(e, t, n, r, i, s) {
                var o = [[e, t, 0], [n, r, 0], [i, s, 1]];
                $(this, S(o, this.m_), !0)
            },
            U.setTransform = function(e, t, n, r, i, s) {
                var o = [[e, t, 0], [n, r, 0], [i, s, 1]];
                $(this, o, !0)
            },
            U.drawText_ = function(e, n, r, i, s) {
                var u = this.m_,
                a = 1e3,
                f = 0,
                l = a,
                c = {
                    x: 0,
                    y: 0
                },
                p = [],
                d = j(B(this.font), this.element_),
                v = F(d),
                m = this.element_.currentStyle,
                g = this.textAlign.toLowerCase();
                switch (g) {
                case "left":
                case "center":
                case "right":
                    break;
                case "end":
                    g = m.direction == "ltr" ? "right": "left";
                    break;
                case "start":
                    g = m.direction == "rtl" ? "right": "left";
                    break;
                default:
                    g = "left"
                }
                switch (this.textBaseline) {
                case "hanging":
                case "top":
                    c.y = d.size / 1.75;
                    break;
                case "middle":
                    break;
                default:
                case null:
                case "alphabetic":
                case "ideographic":
                case "bottom":
                    c.y = -d.size / 2.25
                }
                switch (g) {
                case "right":
                    f = a,
                    l = .05;
                    break;
                case "center":
                    f = l = a / 2
                }
                var y = x(this, n + c.x, r + c.y);
                p.push('<g_vml_:line from="', -f, ' 0" to="', l, ' 0.05" ', ' coordsize="100 100" coordorigin="0 0"', ' filled="', !s, '" stroked="', !!s, '" style="position:absolute;width:1px;height:1px;">'),
                s ? W(this, p) : X(this, p, {
                    x: -f,
                    y: 0
                },
                {
                    x: l,
                    y: d.size
                });
                var b = u[0][0].toFixed(3) + "," + u[1][0].toFixed(3) + "," + u[0][1].toFixed(3) + "," + u[1][1].toFixed(3) + ",0,0",
                w = t(y.x / o) + "," + t(y.y / o);
                p.push('<g_vml_:skew on="t" matrix="', b, '" ', ' offset="', w, '" origin="', f, ' 0" />', '<g_vml_:path textpathok="true" />', '<g_vml_:textpath on="true" string="', h(e), '" style="v-text-align:', g, ";font:", h(v), '" /></g_vml_:line>'),
                this.html_ += p.join("")
            },
            U.fillText = function(e, t, n, r) {
                this.drawText_(e, t, n, r, !1)
            },
            U.strokeText = function(e, t, n, r) {
                this.drawText_(e, t, n, r, !0)
            },
            U.measureText = function(e) {
                if (!this.textMeasureEl_) {
                    var t = '<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>';
                    this.element_.insertAdjacentHTML("beforeEnd", t),
                    this.textMeasureEl_ = this.element_.lastChild
                }
                var n = this.element_.ownerDocument;
                return this.textMeasureEl_.innerHTML = "",
                this.textMeasureEl_.style.font = this.font,
                this.textMeasureEl_.appendChild(n.createTextNode(e)),
                {
                    width: this.textMeasureEl_.offsetWidth
                }
            },
            U.clip = function() {},
            U.arcTo = function() {},
            U.createPattern = function(e, t) {
                return new K(e, t)
            },
            J.prototype.addColorStop = function(e, t) {
                t = D(t),
                this.colors_.push({
                    offset: e,
                    color: t.color,
                    alpha: t.alpha
                })
            };
            var Z = Y.prototype = new Error;
            Z.INDEX_SIZE_ERR = 1,
            Z.DOMSTRING_SIZE_ERR = 2,
            Z.HIERARCHY_REQUEST_ERR = 3,
            Z.WRONG_DOCUMENT_ERR = 4,
            Z.INVALID_CHARACTER_ERR = 5,
            Z.NO_DATA_ALLOWED_ERR = 6,
            Z.NO_MODIFICATION_ALLOWED_ERR = 7,
            Z.NOT_FOUND_ERR = 8,
            Z.NOT_SUPPORTED_ERR = 9,
            Z.INUSE_ATTRIBUTE_ERR = 10,
            Z.INVALID_STATE_ERR = 11,
            Z.SYNTAX_ERR = 12,
            Z.INVALID_MODIFICATION_ERR = 13,
            Z.NAMESPACE_ERR = 14,
            Z.INVALID_ACCESS_ERR = 15,
            Z.VALIDATION_ERR = 16,
            Z.TYPE_MISMATCH_ERR = 17,
            G_vmlCanvasManager = v,
            CanvasRenderingContext2D = R,
            CanvasGradient = J,
            CanvasPattern = K,
            DOMException = Y
        } (),G_vmlCanvasManager
    
    }),
    r("zrender/tool/util", ["require", "../dep/excanvas"], function(e) {
    	// 是否为 dom 对象
        function r(e) {//isDom(obj)
            return e && e.nodeType === 1 && typeof e.nodeName == "string"
        }
        /**
         * 对一个object进行深度拷贝
         * @memberOf module:zrender/tool/util
         * @param {*} e 需要进行拷贝的对象
         * @return {*} 拷贝后的新对象
         */
        function i(e) {
            if (typeof e == "object" && e !== null) {
                var s = e;
                if (e instanceof Array) {
                    s = [];
                    for (var o = 0,
                    u = e.length; o < u; o++) s[o] = i(e[o])
                } else if (!t[n.call(e)] && !r(e)) {// 是否为 dom 对象
                    s = {};
                    for (var a in e) e.hasOwnProperty(a) && (s[a] = i(e[a]))
                }
                return s
            }
            return e
        }
        function s(e, i, s, u) {
            if (i.hasOwnProperty(s)) {
                var a = e[s];
                if(typeof a == "object"&& !t[n.call(a)] && !r(a)){// r(a)是否为 dom 对象
                	// 如果需要递归覆盖，就递归调用o
                	o(e[s], i[s], u)
                }
                else if (u || !(s in e)) {
                	// 否则只处理overwrite(u)为true，或者在目标对象中没有此属性的情况
                	e[s] = i[s]
                }
            }
        }
        /**
         * 合并源对象的属性到目标对象
         * @memberOf module:zrender/tool/util
         * @param {*} target 目标对象
         * @param {*} source 源对象
         * @param {boolean} overwrite 是否覆盖
         */
        function o(e, t, n) {
            for (var r in t) s(e, t, r, n);
            return e
        }
        function a() {
            if (!u) {
                e("../dep/excanvas");
                if (window.G_vmlCanvasManager) {
                    var t = document.createElement("div");
                    t.style.position = "absolute",
                    t.style.top = "-1000px",
                    document.body.appendChild(t),
                    u = G_vmlCanvasManager.initElement(t).getContext("2d")
                } else{
                	u = document.createElement("canvas").getContext("2d")
                } 
            }
            return u
        }
        function v() {
            return l || (f = document.createElement("canvas"), c = f.width, h = f.height, l = f.getContext("2d")),
            l
        }
        function m(e, t) {
            var n = 100,
            r;
            e + p > c && (c = e + p + n, f.width = c, r = !0),
            t + d > h && (h = t + d + n, f.height = h, r = !0),
            e < -p && (p = Math.ceil( - e / n) * n, c += p, f.width = c, r = !0),
            t < -d && (d = Math.ceil( - t / n) * n, h += d, f.height = h, r = !0),
            r && l.translate(p, d)
        }
        function g() {
            return {
                x: p,
                y: d
            }
        }
        function y(e, t) {
            if (e.indexOf) return e.indexOf(t);
            for (var n = 0,
            r = e.length; n < r; n++) if (e[n] === t) return n;
            return - 1
        }
        /**
         * 构造类继承关系
         * @memberOf module:zrender/tool/util
         * @param {Function} e 源类
         * @param {Function} t 基类
         */
        function b(e, t) {
            function r() {}
            var n = e.prototype;
            r.prototype = t.prototype,
            e.prototype = new r;
            for (var i in n) e.prototype[i] = n[i];
            e.constructor = e
        }
     // 用于处理o方法时无法遍历Date等对象的问题
        var t = {
            "[object Function]": 1,
            "[object RegExp]": 1,
            "[object Date]": 1,
            "[object Error]": 1,
            "[object CanvasGradient]": 1
        },
        n = Object.prototype.toString,
        u,
        f,
        l,
        c,
        h,
        p = 0,
        d = 0;
        return {
            inherits: b,
            clone: i,
            merge: o,
            getContext: a,
            getPixelContext: v,
            getPixelOffset: g,
            adjustCanvasSize: m,
            indexOf: y
        }
    }),
    /**
     * config默认配置项
     * @exports zrender/config
     * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
     */
    r("zrender/config", [], function() {
        var config = {
            EVENT: {
	        	/**
	            * 窗口大小变化
	            * @type {string}
	            */
                RESIZE: "resize",
                /**
                 * 鼠标按钮被（手指）按下，事件对象是：目标图形元素或空
                 * @type {string}
                 */
                CLICK: "click",
                /**
                 * 双击事件
                 * @type {string}
                 */
                DBLCLICK: "dblclick",
                /**
                 * 鼠标滚轮变化，事件对象是：目标图形元素或空
                 * @type {string}
                 */
                MOUSEWHEEL: "mousewheel",
                /**
                 * 鼠标（手指）被移动，事件对象是：目标图形元素或空
                 * @type {string}
                 */
                MOUSEMOVE: "mousemove",
                /**
                 * 鼠标移到某图形元素之上，事件对象是：目标图形元素
                 * @type {string}
                 */
                MOUSEOVER: "mouseover",
                /**
                 * 鼠标从某图形元素移开，事件对象是：目标图形元素
                 * @type {string}
                 */
                MOUSEOUT: "mouseout",
                /**
                 * 鼠标按钮（手指）被按下，事件对象是：目标图形元素或空
                 * @type {string}
                 */
                MOUSEDOWN: "mousedown",
                /**
                 * 鼠标按键（手指）被松开，事件对象是：目标图形元素或空
                 * @type {string}
                 */
                MOUSEUP: "mouseup",
                /**
                 * 全局离开，MOUSEOUT触发比较频繁，一次离开优化绑定
                 * @type {string}
                 */
                GLOBALOUT: "globalout",
                // 一次成功元素拖拽的行为事件过程是：
                // dragstart > dragenter > dragover [> dragleave] > drop > dragend
                /**
                 * 开始拖拽时触发，事件对象是：被拖拽图形元素
                 * @type {string}
                 */
                DRAGSTART: "dragstart",
                /**
                 * 拖拽完毕时触发（在drop之后触发），事件对象是：被拖拽图形元素
                 * @type {string}
                 */
                DRAGEND: "dragend",
                /**
                 * 拖拽图形元素进入目标图形元素时触发，事件对象是：目标图形元素
                 * @type {string}
                 */
                DRAGENTER: "dragenter",
                /**
                 * 拖拽图形元素在目标图形元素上移动时触发，事件对象是：目标图形元素
                 * @type {string}
                 */
                DRAGOVER: "dragover",
                /**
                 * 拖拽图形元素离开目标图形元素时触发，事件对象是：目标图形元素
                 * @type {string}
                 */
                DRAGLEAVE: "dragleave",
                /**
                 * 拖拽图形元素放在目标图形元素内时触发，事件对象是：目标图形元素
                 * @type {string}
                 */
                DROP: "drop",
                /**
                 * touch end - start < delay is click
                 * @type {number}
                 */
                touchClickDelay: 300
            },
            // 是否异常捕获
            catchBrushException: !1,//!1  false
            /**
             * debug日志选项：catchBrushException为true下有效
             * 0 : 不生成debug数据，发布用
             * 1 : 异常抛出，调试用
             * 2 : 控制台输出，调试用
             */
            debugMode: 0,
            // retina 屏幕优化
            devicePixelRatio: Math.max(window.devicePixelRatio || 1, 1)
        };
        return config
    }),
    
    r("zrender/tool/log", ["require", "../config"], function(e) {
        var t = e("../config");
        return function() {
            if (t.debugMode === 0) return;
            if (t.debugMode == 1) for (var e in arguments) throw new Error(arguments[e]);
            else if (t.debugMode > 1) for (var e in arguments) console.log(arguments[e])
        }
    }),
    
    /**
     * zrender: 生成唯一id
     */
    r("zrender/tool/guid", [], function() {
        var e = 2311;
        return function() {
            return "zrender__" + e++
        }
    }),
    
    /**
     * echarts设备环境识别
     * @desc echarts基于Canvas，纯Javascript图表库，提供直观，生动，可交互，可个性化定制的数据统计图表。
     */
    r("zrender/tool/env", [], function() {
        function e(e) {
            var t = this.os = {},
            n = this.browser = {},
            r = e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),
            i = e.match(/(Android);?[\s\/]+([\d.]+)?/),
            s = e.match(/(iPad).*OS\s([\d_]+)/),
            o = e.match(/(iPod)(.*OS\s([\d_]+))?/),
            u = !s && e.match(/(iPhone\sOS)\s([\d_]+)/),
            a = e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),
            f = a && e.match(/TouchPad/),
            l = e.match(/Kindle\/([\d.]+)/),
            c = e.match(/Silk\/([\d._]+)/),
            h = e.match(/(BlackBerry).*Version\/([\d.]+)/),
            p = e.match(/(BB10).*Version\/([\d.]+)/),
            d = e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),
            v = e.match(/PlayBook/),
            m = e.match(/Chrome\/([\d.]+)/) || e.match(/CriOS\/([\d.]+)/),
            g = e.match(/Firefox\/([\d.]+)/),
            y = e.match(/MSIE ([\d.]+)/),
            b = r && e.match(/Mobile\//) && !m,
            w = e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !m,
            y = e.match(/MSIE\s([\d.]+)/);
            if (n.webkit = !!r) n.version = r[1];
            return i && (t.android = !0, t.version = i[2]),
            u && !o && (t.ios = t.iphone = !0, t.version = u[2].replace(/_/g, ".")),
            s && (t.ios = t.ipad = !0, t.version = s[2].replace(/_/g, ".")),
            o && (t.ios = t.ipod = !0, t.version = o[3] ? o[3].replace(/_/g, ".") : null),
            a && (t.webos = !0, t.version = a[2]),
            f && (t.touchpad = !0),
            h && (t.blackberry = !0, t.version = h[2]),
            p && (t.bb10 = !0, t.version = p[2]),
            d && (t.rimtabletos = !0, t.version = d[2]),
            v && (n.playbook = !0),
            l && (t.kindle = !0, t.version = l[1]),
            c && (n.silk = !0, n.version = c[1]),
            !c && t.android && e.match(/Kindle Fire/) && (n.silk = !0),
            m && (n.chrome = !0, n.version = m[1]),
            g && (n.firefox = !0, n.version = g[1]),
            y && (n.ie = !0, n.version = y[1]),
            b && (e.match(/Safari/) || !!t.ios) && (n.safari = !0),
            w && (n.webview = !0),
            y && (n.ie = !0, n.version = y[1]),
            t.tablet = !!(s || v || i && !e.match(/Mobile/) || g && e.match(/Tablet/) || y && !e.match(/Phone/) && e.match(/Touch/)),
            t.phone = !!(!t.tablet && !t.ipod && (i || u || a || h || p || m && e.match(/Android/) || m && e.match(/CriOS\/([\d.]+)/) || g && e.match(/Mobile/) || y && e.match(/Touch/))),
            {
                browser: n,
                os: t,
                canvasSupported: document.createElement("canvas").getContext ? !0 : !1
            }
        }
        return e(navigator.userAgent)
    }),
    //事件分发器
    r("zrender/mixin/Eventful", ["require"], function(e) {
        var t = function() {
            this._handlers = {}
        };
        /**
         * 单次触发绑定，dispatch后销毁
         * 
         * @param {string} event 事件名
         * @param {Function} handler 响应函数
         * @param {Object} context
         */
        return t.prototype.one = function(e, t, n) {
            var r = this._handlers;
            return ! t || !e ? this: (r[e] || (r[e] = []), r[e].push({
                h: t,
                one: !0,
                ctx: n || this
            }), this)
        },
        //绑定事件
        t.prototype.bind = function(e, t, n) {
            var r = this._handlers;
            return ! t || !e ? this: (r[e] || (r[e] = []), r[e].push({
                h: t,
                one: !1,
                ctx: n || this
            }), this)
        },
        //解绑事件
        t.prototype.unbind = function(e, t) {
            var n = this._handlers;
            if (!e) {
            	return this._handlers = {}
            }
            this;
            if (t) {
                if (n[e]) {
                    var r = [];
                    for (var i = 0,
                    s = n[e].length; i < s; i++) n[e][i]["h"] != t && r.push(n[e][i]);
                    n[e] = r
                }
                n[e] && n[e].length === 0 && delete n[e]
            } else {
            	delete n[e];
            }
            return this
        },
        //事件分发
        t.prototype.dispatch = function(e) {
            if (this._handlers[e]) {
                var t = arguments,
                n = t.length;
                n > 3 && (t = Array.prototype.slice.call(t, 1));
                var r = this._handlers[e],
                i = r.length;
                for (var s = 0; s < i;) {
                    switch (n) {
                    case 1:
                        r[s].h.call(r[s].ctx);
                        break;
                    case 2:
                        r[s].h.call(r[s].ctx, t[1]);
                        break;
                    case 3:
                        r[s].h.call(r[s].ctx, t[1], t[2]);
                        break;
                    default:
                        r[s].h.apply(r[s].ctx, t)
                    }
                    r[s].one ? (r.splice(s, 1), i--) : s++
                }
            }
            return this
        },
        //带有context的事件分发, 最后一个参数是事件回调的context
        t.prototype.dispatchWithContext = function(e) {
            if (this._handlers[e]) {
                var t = arguments,
                n = t.length;
                n > 4 && (t = Array.prototype.slice.call(t, 1, t.length - 1));
                var r = t[t.length - 1],
                i = this._handlers[e],
                s = i.length;
                for (var o = 0; o < s;) {
                    switch (n) {
                    case 1:
                        i[o].h.call(r);
                        break;
                    case 2:
                        i[o].h.call(r, t[1]);
                        break;
                    case 3:
                        i[o].h.call(r, t[1], t[2]);
                        break;
                    default:
                        i[o].h.apply(r, t)
                    }
                    i[o].one ? (i.splice(o, 1), s--) : o++
                }
            }
            return this
        },
        t
    }),
    /**
     * 事件辅助类
     * @module zrender/tool/event
     * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
     */
    r("zrender/tool/event", ["require", "../mixin/Eventful"], function(e) {
    	/**
         * 提取鼠标（手指）x坐标
         * @memberOf module:zrender/tool/event
         * @param  {Event} e 事件.
         * @return {number} 鼠标（手指）x坐标.
         */
        function n(e) {//getX(e)
            return typeof e.zrenderX != "undefined" && e.zrenderX 
                || typeof e.offsetX != "undefined" && e.offsetX 
                || typeof e.layerX != "undefined" && e.layerX 
                || typeof e.clientX != "undefined" && e.clientX
        }
        /**
         * 提取鼠标y坐标
         * @memberOf module:zrender/tool/event
         * @param  {Event} e 事件.
         * @return {number} 鼠标（手指）y坐标.
         */
        function r(e) {//getY(e)
            return typeof e.zrenderY != "undefined" && e.zrenderY 
                || typeof e.offsetY != "undefined" && e.offsetY 
                || typeof e.layerY != "undefined" && e.layerY 
                || typeof e.clientY != "undefined" && e.clientY
        }
        /**
         * 提取鼠标滚轮变化
         * @memberOf module:zrender/tool/event
         * @param  {Event} e 事件.
         * @return {number} 滚轮变化，正值说明滚轮是向上滚动，如果是负值说明滚轮是向下滚动
         */
        function i(e) {//getDelta(e)
            return typeof e.zrenderDelta != "undefined" && e.zrenderDelta 
        		|| typeof e.wheelDelta != "undefined" && e.wheelDelta 
        		|| typeof e.detail != "undefined" && -e.detail
        }
        var t = e("../mixin/Eventful"),
        /**
         * 停止冒泡和阻止默认行为
         * @memberOf module:zrender/tool/event
         * @method
         * @param {Event} e : event对象
         */
        s = typeof window.addEventListener == "function" ? function(e) {
            e.preventDefault(),
            e.stopPropagation(),
            e.cancelBubble = !0
        }: function(e) {
            e.returnValue = !1,
            e.cancelBubble = !0
        };
        return {
            getX: n,
            getY: r,
            getDelta: i,
            stop: s,
            Dispatcher: t  // 做向上兼容
        }
    }),
    //二维向量类
    r("zrender/tool/vector", [], function() {
        var e = typeof Float32Array == "undefined" ? Array: Float32Array,
        t = {
    		//创建一个向量
            create: function(t, n) {
                var r = new e(2);
                return r[0] = t || 0,
                r[1] = n || 0,
                r
            },
            //复制向量数据
            copy: function(e, t) {
                return e[0] = t[0],
                e[1] = t[1],
                e
            },
            //克隆一个向量
            clone: function(t) {
                var n = new e(2);
                return n[0] = t[0],
                n[1] = t[1],
                n
            },
            //设置向量的两个项
            set: function(e, t, n) {
                return e[0] = t,
                e[1] = n,
                e
            },
            //向量相加
            add: function(e, t, n) {
                return e[0] = t[0] + n[0],
                e[1] = t[1] + n[1],
                e
            },
            //向量缩放后相加
            scaleAndAdd: function(e, t, n, r) {
                return e[0] = t[0] + n[0] * r,
                e[1] = t[1] + n[1] * r,
                e
            },
            //向量相减
            sub: function(e, t, n) {
                return e[0] = t[0] - n[0],
                e[1] = t[1] - n[1],
                e
            },
            //向量长度
            len: function(e) {
                return Math.sqrt(this.lenSquare(e))
            },
            //向量长度平方
            lenSquare: function(e) {
                return e[0] * e[0] + e[1] * e[1]
            },
            //向量乘法
            mul: function(e, t, n) {
                return e[0] = t[0] * n[0],
                e[1] = t[1] * n[1],
                e
            },
            //向量除法
            div: function(e, t, n) {
                return e[0] = t[0] / n[0],
                e[1] = t[1] / n[1],
                e
            },
            //向量点乘
            dot: function(e, t) {
                return e[0] * t[0] + e[1] * t[1]
            },
            //向量缩放
            scale: function(e, t, n) {
                return e[0] = t[0] * n,
                e[1] = t[1] * n,
                e
            },
            //向量归一化
            normalize: function(e, n) {
                var r = t.len(n);
                return r === 0 ? (e[0] = 0, e[1] = 0) : (e[0] = n[0] / r, e[1] = n[1] / r),
                e
            },
            //计算向量间距离
            distance: function(e, t) {
                return Math.sqrt((e[0] - t[0]) * (e[0] - t[0]) + (e[1] - t[1]) * (e[1] - t[1]))
            },
            //向量距离平方
            distanceSquare: function(e, t) {
                return (e[0] - t[0]) * (e[0] - t[0]) + (e[1] - t[1]) * (e[1] - t[1])
            },
            //求负向量
            negate: function(e, t) {
                return e[0] = -t[0],
                e[1] = -t[1],
                e
            },
            //插值两个点
            lerp: function(e, t, n, r) {
                return e[0] = t[0] + r * (n[0] - t[0]),
                e[1] = t[1] + r * (n[1] - t[1]),
                e
            },
            //矩阵左乘向量
            applyTransform: function(e, t, n) {
                var r = t[0],
                i = t[1];
                return e[0] = n[0] * r + n[2] * i + n[4],
                e[1] = n[1] * r + n[3] * i + n[5],
                e
            },
            //求两个向量最小值
            min: function(e, t, n) {
                return e[0] = Math.min(t[0], n[0]),
                e[1] = Math.min(t[1], n[1]),
                e
            },
            //求两个向量最大值
            max: function(e, t, n) {
                return e[0] = Math.max(t[0], n[0]),
                e[1] = Math.max(t[1], n[1]),
                e
            }
        };
        return t.length = t.len,
        t.lengthSquare = t.lenSquare,
        t.dist = t.distance,
        t.distSquare = t.distanceSquare,
        t
    }),
    //3x2矩阵操作类
    r("zrender/tool/matrix", [], function() {
        var e = typeof Float32Array == "undefined" ? Array: Float32Array,
        t = {
    		/**
             * 创建一个单位矩阵
             * @return {Float32Array|Array.<number>}
             */
            create: function() {
                var n = new e(6);
                return t.identity(n),
                n
            },
            /**
             * 设置矩阵为单位矩阵
             * @param {Float32Array|Array.<number>} out
             */
            identity: function(e) {
                return e[0] = 1,
                e[1] = 0,
                e[2] = 0,
                e[3] = 1,
                e[4] = 0,
                e[5] = 0,
                e
            },
            /**
             * 复制矩阵
             * @param {Float32Array|Array.<number>} out
             * @param {Float32Array|Array.<number>} m
             */
            copy: function(e, t) {
                return e[0] = t[0],
                e[1] = t[1],
                e[2] = t[2],
                e[3] = t[3],
                e[4] = t[4],
                e[5] = t[5],
                e
            },
            /**
             * 矩阵相乘
             * @param {Float32Array|Array.<number>} out
             * @param {Float32Array|Array.<number>} m1
             * @param {Float32Array|Array.<number>} m2
             */
            mul: function(e, t, n) {
                return e[0] = t[0] * n[0] + t[2] * n[1],
                e[1] = t[1] * n[0] + t[3] * n[1],
                e[2] = t[0] * n[2] + t[2] * n[3],
                e[3] = t[1] * n[2] + t[3] * n[3],
                e[4] = t[0] * n[4] + t[2] * n[5] + t[4],
                e[5] = t[1] * n[4] + t[3] * n[5] + t[5],
                e
            },
            /**
             * 平移变换
             * @param {Float32Array|Array.<number>} out
             * @param {Float32Array|Array.<number>} a
             * @param {Float32Array|Array.<number>} v
             */
            translate: function(e, t, n) {
                return e[0] = t[0],
                e[1] = t[1],
                e[2] = t[2],
                e[3] = t[3],
                e[4] = t[4] + n[0],
                e[5] = t[5] + n[1],
                e
            },
            /**
             * 旋转变换
             * @param {Float32Array|Array.<number>} out
             * @param {Float32Array|Array.<number>} a
             * @param {number} rad
             */
            rotate: function(e, t, n) {
                var r = t[0],
                i = t[2],
                s = t[4],
                o = t[1],
                u = t[3],
                a = t[5],
                f = Math.sin(n),
                l = Math.cos(n);
                return e[0] = r * l + o * f,
                e[1] = -r * f + o * l,
                e[2] = i * l + u * f,
                e[3] = -i * f + l * u,
                e[4] = l * s + f * a,
                e[5] = l * a - f * s,
                e
            },
            /**
             * 缩放变换
             * @param {Float32Array|Array.<number>} out
             * @param {Float32Array|Array.<number>} a
             * @param {Float32Array|Array.<number>} v
             */
            scale: function(e, t, n) {
                var r = n[0],
                i = n[1];
                return e[0] = t[0] * r,
                e[1] = t[1] * i,
                e[2] = t[2] * r,
                e[3] = t[3] * i,
                e[4] = t[4] * r,
                e[5] = t[5] * i,
                e
            },
            /**
             * 求逆矩阵
             * @param {Float32Array|Array.<number>} out
             * @param {Float32Array|Array.<number>} a
             */
            invert: function(e, t) {
                var n = t[0],
                r = t[2],
                i = t[4],
                s = t[1],
                o = t[3],
                u = t[5],
                a = n * o - s * r;
                return a ? (a = 1 / a, e[0] = o * a, e[1] = -s * a, e[2] = -r * a, e[3] = n * a, e[4] = (r * u - o * i) * a, e[5] = (s * i - n * u) * a, e) : null
            },
            mulVector: function(e, t, n) {
                var r = t[0],
                i = t[2],
                s = t[4],
                o = t[1],
                u = t[3],
                a = t[5];
                return e[0] = n[0] * r + n[1] * i + s,
                e[1] = n[0] * o + n[1] * u + a,
                e
            }
        };
        return t
    }),
    /**
     * Handler控制模块
     * @module zrender/Handler
     * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
     *         errorrik (errorrik@gmail.com)
     *
     */
    r("zrender/Handler", ["require", "./config", "./tool/env", "./tool/event", "./tool/util", "./tool/vector", "./tool/matrix", "./mixin/Eventful"],
    function(e) {
    	/**
         * bind一个参数的function
         * @inner
         * @param {Function} handler 要bind的function
         * @param {Object} context 运行时this环境
         * @return {Function}
         */
        function c(e, t) {
            return function(n) {
                return e.call(t, n)
            }
        }
        function h(e, t) {
            return function(n, r, i) {
                return e.call(t, n, r, i)
            }
        }
        /**
         * 为控制类实例初始化dom 事件处理函数
         * 
         * @inner
         * @param {module:zrender/Handler} instance 控制类实例
         */
        function p(e) {
            var t = f.length;
            while (t--) {
                var n = f[t];
                e["_" + n + "Handler"] = c(l[n], e)
            }
        }
        /**
         * 迭代函数，查找hover到的图形元素并即时做些事件分发
         * @inner
         * @param {Object} shape 图形元素
         * @param {number} x
         * @param {number} y
         */
        function m(e, t, n) {
            if (
        		(this._draggingTarget && this._draggingTarget.id == e.id) // 迭代到当前拖拽的图形上 
        		|| e.isSilent() // 打酱油的路过，啥都不响应的shape~
    		) {
            	return !1; // !1 false
            }
        	
            var r = this._event;
            if (e.isCover(t, n)) {
            	if (e.hoverable) {
            		this.storage.addHover(e);
                }
            	// 查找是否在 clipShape 中
                var i = e.parent;
                while (i) {
                    if (i.clipShape && !i.clipShape.isCover(this._mouseX, this._mouseY)) {
                    	// 已经被祖先 clip 掉了
                    	return ! 1;
                    }
                    i = i.parent
                }
                
                if(this._lastHover != e){
                	this._processOutShape(r), 
                	// 可能出现config.EVENT.DRAGLEAVE事件
                	this._processDragLeave(r), 
                	this._lastHover = e, 
                	// 可能出现config.EVENT.DRAGENTER事件
                	this._processDragEnter(r)
                }
                this._processOverShape(r),
                this._processDragOver(r),// 可能出现config.EVENT.DRAGOVER
                this._hasfound = 1;
                return !0  // 找到则中断迭代查找
            }
            return ! 1
        }
        var t = e("./config"),
        n = e("./tool/env"),
        r = e("./tool/event"),
        i = e("./tool/util"),
        s = e("./tool/vector"),
        o = e("./tool/matrix"),
        u = t.EVENT,
        a = e("./mixin/Eventful"),
        f = ["resize", "click", "dblclick", "mousewheel", "mousemove", "mouseout", "mouseup", "mousedown", "touchstart", "touchend", "touchmove"],
        l = {
        	/**
             * 窗口大小改变响应函数
             * @inner
             * @param {Event} event
             */
            resize: function(e) {
                e = e || window.event,
                this._lastHover = null,
                this._isMouseDown = 0,
                // 分发config.EVENT.RESIZE事件，global
                this.dispatch(u.RESIZE, e)
            },
            /**yyh
             * 点击响应函数
             * @inner
             * @param {Event} event
             */
            click: function(e) {
            	/*yyh画布的点击事件*/
            	var aa = $("#markInfo")[0].style.display;
            	if(aa=="block"){
            		$("#markInfo").css('display','none');
            		$("#textarea")[0].value = "";
            	}
                e = this._zrenderEventFixed(e);
                // 分发config.EVENT.CLICK事件
                var t = this._lastHover; 
                if((t && t.clickable) || !t){
                	//判断没有发生拖拽才触发click事件
                    if (this._clickThreshold < 5) {
                    	this._dispatchAgency(t, u.CLICK, e);
                    }
                } 
                this._mousemoveHandler(e)
            },
            /**yyh
             * 双击响应函数
             * @inner
             * @param {Event} event
             */
            dblclick: function(e) {
                e = e || window.event,
                e = this._zrenderEventFixed(e);
                // 分发config.EVENT.DBLCLICK事件
                var t = this._lastHover; 
                if ((t && t.clickable)|| !t) {
                    // 判断没有发生拖拽才触发dblclick事件
                    if (this._clickThreshold < 5) {
                    	this._dispatchAgency(t, u.DBLCLICK, e)
                    }
                }
                this._mousemoveHandler(e);
            },
            /**yyh
             * 鼠标滚轮响应函数
             * @inner
             * @param {Event} event
             */
            mousewheel: function(e) {
                e = this._zrenderEventFixed(e);
                var t = e.wheelDelta || -e.detail,//IE是event.wheelDelta Firefox是event.detail 属性的方向值也不一样，IE向上滚 > 0，Firefox向下滚 > 0。
                n = t > 0 ? 1.1 : 1 / 1.1,//鼠标滚轮向上滚是1.1，否则是0.9（1/1.1）
                s = this._mouseX,
                o = this._mouseY;
                this.painter.eachBuildinLayer(function(t) {
                    var u = t.position;
                    if (t.zoomable) {
                        t.__zoom = t.__zoom || 1;
                        var a = t.__zoom;
                        a *= n,
                        a = Math.max(Math.min(t.maxZoom, a), t.minZoom),
                        n = a / t.__zoom,
                        t.__zoom = a,
                        u[0] -= (s - u[0]) * (n - 1),/*x轴方向拉伸缩小*/
                        u[1] -= (o - u[1]) * (n - 1),/*y轴方向拉伸缩小*/
                        t.scale[0] *= n,/*x轴方向拉伸缩小*/
                        t.scale[1] *= n,/*y轴方向拉伸缩小*/
                        t.dirty = !0,
                        i = !0,//needsRefresh = true;
                        r.stop(e)
                    }
                });
                if(i){
                	this.painter.refresh();
                }
                // 分发config.EVENT.MOUSEWHEEL事件
                this._dispatchAgency(this._lastHover, u.MOUSEWHEEL, e),
                this._mousemoveHandler(e)
            },
            /**
             * 鼠标（手指）移动响应函数  画布拖拽
             * @inner
             * @param {Event} event
             */
            mousemove: function(e) {
                if (this.painter.isLoading()) return;
                e = this._zrenderEventFixed(e),
                this._lastX = this._mouseX,
                this._lastY = this._mouseY,
                this._mouseX = r.getX(e),
                this._mouseY = r.getY(e);
                var t = this._mouseX - this._lastX,
                n = this._mouseY - this._lastY;
                // 可能出现config.EVENT.DRAGSTART事件
                // 避免手抖点击误认为拖拽
                this._processDragStart(e),
                this._hasfound = 0,
                this._event = e,
                this._iterateAndFindHover();
                // 找到的在迭代函数里做了处理，没找到得在迭代完后处理
                if (!this._hasfound) {
                	// 过滤首次拖拽产生的mouseout和dragLeave
                    if (!this._draggingTarget || (this._lastHover && this._lastHover != this._draggingTarget)){
                    	// 可能出现config.EVENT.MOUSEOUT事件
                    	this._processOutShape(e),
                    	// 可能出现config.EVENT.DRAGLEAVE事件
                    	this._processDragLeave(e);
                    } 
                    this._lastHover = null,
                    this.storage.delHover(),
                    this.painter.clearHover()
                }
                var i = "default";
                // 如果存在拖拽中元素，被拖拽的图形元素最后addHover
                if (this._draggingTarget) this.storage.drift(this._draggingTarget.id, t, n),
                this._draggingTarget.modSelf(),
                this.storage.addHover(this._draggingTarget),
                // 拖拽不触发click事件
                this._clickThreshold++;
                else if (this._isMouseDown) {
                    var s = !1;
                    this.painter.eachBuildinLayer(function(e) {
                        e.panable && (i = "move", e.position[0] += t, e.position[1] += n, s = !0, e.dirty = !0)
                    }),
                    s && this.painter.refresh()
                }
                this._draggingTarget || this._hasfound && this._lastHover.draggable ? i = "move": this._hasfound && this._lastHover.clickable && (i = "pointer"),
                this.root.style.cursor = i,
                // 分发config.EVENT.MOUSEMOVE事件
                this._dispatchAgency(this._lastHover, u.MOUSEMOVE, e),
                (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) && this.painter.refreshHover()
            },
            /**
             * 鼠标（手指）离开响应函数
             * @inner
             * @param {Event} event
             */
            mouseout: function(e) {
                e = this._zrenderEventFixed(e);
                var t = e.toElement || e.relatedTarget;
                if (t != this.root){ 	
                	while (t && t.nodeType != 9) {
                		// 忽略包含在root中的dom引起的mouseOut
	                    if (t == this.root) {
	                        this._mousemoveHandler(e);
	                        return
	                    }
	                    t = t.parentNode
                	}
                }
                e.zrenderX = this._lastX,
                e.zrenderY = this._lastY,
                this.root.style.cursor = "default",
                this._isMouseDown = 0,
                this._processOutShape(e),
                this._processDrop(e),
                this._processDragEnd(e),
                this.painter.isLoading() || this.painter.refreshHover(),
                this.dispatch(u.GLOBALOUT, e)
            },
            /**
             * 鼠标（手指）按下响应函数
             * @inner
             * @param {Event} event
             */
            mousedown: function(e) {
                this._clickThreshold = 0;
                if (this._lastDownButton == 2) {
                    this._lastDownButton = e.button,
                    this._mouseDownTarget = null;
                    return
                }
                this._lastMouseDownMoment = new Date,
                e = this._zrenderEventFixed(e),
                this._isMouseDown = 1,
                this._mouseDownTarget = this._lastHover,
                this._dispatchAgency(this._lastHover, u.MOUSEDOWN, e),
                this._lastDownButton = e.button
            },
            mouseup: function(e) {
                e = this._zrenderEventFixed(e),
                this.root.style.cursor = "default",
                this._isMouseDown = 0,
                this._mouseDownTarget = null,
                this._dispatchAgency(this._lastHover, u.MOUSEUP, e),
                this._processDrop(e),
                this._processDragEnd(e)
            },
            touchstart: function(e) {
                e = this._zrenderEventFixed(e, !0),
                this._lastTouchMoment = new Date,
                this._mobileFindFixed(e),
                this._mousedownHandler(e)
            },
            touchmove: function(e) {
                e = this._zrenderEventFixed(e, !0),
                this._mousemoveHandler(e),
                this._isDragging && r.stop(e)
            },
            touchend: function(e) {
                e = this._zrenderEventFixed(e, !0),
                this._mouseupHandler(e);
                var t = new Date;
                t - this._lastTouchMoment < u.touchClickDelay && (this._mobileFindFixed(e), this._clickHandler(e), t - this._lastClickMoment < u.touchClickDelay / 2 && (this._dblclickHandler(e), this._lastHover && this._lastHover.clickable && r.stop(e)), this._lastClickMoment = t),
                this.painter.clearHover()
            }
        },
        /**
         * @alias module:zrender/Handler
         * @constructor
         * @extends module:zrender/mixin/Eventful
         * @param {HTMLElement} root 绘图区域
         * @param {module:zrender/Storage} storage Storage实例
         * @param {module:zrender/Painter} painter Painter实例
         */
        d = function(e, t, r) {
        	// 添加事件分发器特性
            a.call(this),
            this.root = e,
            this.storage = t,
            this.painter = r,
            // 各种事件标识的私有变量
            // this._hasfound = false;              //是否找到hover图形元素
            // this._lastHover = null;              //最后一个hover图形元素
            // this._mouseDownTarget = null;
            // this._draggingTarget = null;         //当前被拖拽的图形元素
            // this._isMouseDown = false;
            // this._isDragging = false;
            // this._lastMouseDownMoment;
            // this._lastTouchMoment;
            // this._lastDownButton;
            this._lastX = this._lastY = this._mouseX = this._mouseY = 0,
            this._findHover = h(m, this),
            this._domHover = r.getDomHover(),
            p(this);
            // 初始化，事件绑定，支持的所有事件都由如下原生事件计算得来
            if(window.addEventListener){
            	 window.addEventListener('resize', this._resizeHandler);
            	 if (n.os.tablet || n.os.phone) {
                     // mobile支持
            		 e.addEventListener("touchstart", this._touchstartHandler),
    				 e.addEventListener("touchmove", this._touchmoveHandler),
                     e.addEventListener('touchend', this._touchendHandler);
                 }else{
                	// mobile的click/move/up/down自己模拟
                     e.addEventListener('click', this._clickHandler);
                     e.addEventListener('dblclick', this._dblclickHandler);
                     e.addEventListener('mousewheel', this._mousewheelHandler);
                     e.addEventListener('mousemove', this._mousemoveHandler);
                     e.addEventListener('mousedown', this._mousedownHandler);
                     e.addEventListener('mouseup', this._mouseupHandler);
                 }
            	 e.addEventListener('DOMMouseScroll', this._mousewheelHandler);
                 e.addEventListener('mouseout', this._mouseoutHandler);
            }else{
            	window.attachEvent('onresize', this._resizeHandler);
                e.attachEvent('onclick', this._clickHandler);
                //root.attachEvent('ondblclick ', this._dblclickHandler);
                e.ondblclick = this._dblclickHandler;
                e.attachEvent('onmousewheel', this._mousewheelHandler);
                e.attachEvent('onmousemove', this._mousemoveHandler);
                e.attachEvent('onmouseout', this._mouseoutHandler);
                e.attachEvent('onmousedown', this._mousedownHandler);
                e.attachEvent('onmouseup', this._mouseupHandler);
            }
        };
        /**
         * 自定义事件绑定
         * @param {string} eventName 事件名称，resize，hover，drag，etc~
         * @param {Function} handler 响应函数
         * @param {Object} [context] 响应函数
         */
        d.prototype.on = function(e, t, n) {
            return this.bind(e, t, n),
            this
        },
        /**
         * 自定义事件解绑
         * @param {string} eventName 事件名称，resize，hover，drag，etc~
         * @param {Function} handler 响应函数
         */
        d.prototype.un = function(e, t) {
            return this.unbind(e, t),
            this
        },
        /**
         * 事件触发
         * @param {string} eventName 事件名称，resize，hover，drag，etc~
         * @param {event=} eventArgs event dom事件对象
         */
        d.prototype.trigger = function(e, t) {
            switch (e) {
            case u.RESIZE:
            case u.CLICK:
            case u.DBLCLICK:
            case u.MOUSEWHEEL:
            case u.MOUSEMOVE:
            case u.MOUSEDOWN:
            case u.MOUSEUP:
            case u.MOUSEOUT:
                this["_" + e + "Handler"](t)
            }
        },
        /**
         * 释放，解绑所有事件
         */
        d.prototype.dispose = function() {
            var e = this.root;
            window.removeEventListener ? (window.removeEventListener("resize", this._resizeHandler), n.os.tablet || n.os.phone ? (e.removeEventListener("touchstart", this._touchstartHandler), e.removeEventListener("touchmove", this._touchmoveHandler), e.removeEventListener("touchend", this._touchendHandler)) : (e.removeEventListener("click", this._clickHandler), e.removeEventListener("dblclick", this._dblclickHandler), e.removeEventListener("mousewheel", this._mousewheelHandler), e.removeEventListener("mousemove", this._mousemoveHandler), e.removeEventListener("mousedown", this._mousedownHandler), e.removeEventListener("mouseup", this._mouseupHandler)), e.removeEventListener("DOMMouseScroll", this._mousewheelHandler), e.removeEventListener("mouseout", this._mouseoutHandler)) : (window.detachEvent("onresize", this._resizeHandler), e.detachEvent("onclick", this._clickHandler), e.detachEvent("dblclick", this._dblclickHandler), e.detachEvent("onmousewheel", this._mousewheelHandler), e.detachEvent("onmousemove", this._mousemoveHandler), e.detachEvent("onmouseout", this._mouseoutHandler), e.detachEvent("onmousedown", this._mousedownHandler), e.detachEvent("onmouseup", this._mouseupHandler)),
            this.root = this._domHover = this.storage = this.painter = null,
            this.un()
        },
        /**
         * 拖拽开始
         * 
         * @private
         * @param {Object} event 事件对象
         */
        d.prototype._processDragStart = function(e) {
            var t = this._lastHover;
            if (this._isMouseDown && t && t.draggable && !this._draggingTarget && this._mouseDownTarget == t) {
            	// 拖拽点击生效时长阀门，某些场景需要降低拖拽敏感度
                if (t.dragEnableTime && new Date - this._lastMouseDownMoment < t.dragEnableTime) {
                	return;
                }
                var n = t;
                this._draggingTarget = n,
                this._isDragging = 1,
                n.invisible = !0,
                this.storage.mod(n.id),
                // 分发config.EVENT.DRAGSTART事件
                this._dispatchAgency(n, u.DRAGSTART, e),
                this.painter.refresh()
            }
        },
        /**
         * 拖拽进入目标元素
         * 
         * @private
         * @param {Object} event 事件对象
         */
        d.prototype._processDragEnter = function(e) {
        	if(this._draggingTarget){
        		// 分发config.EVENT.DRAGENTER事件
                this._dispatchAgency(this._lastHover, u.DRAGENTER, e, this._draggingTarget)
        	}
        },
        /**
         * 拖拽在目标元素上移动
         * 
         * @private
         * @param {Object} event 事件对象
         */
        d.prototype._processDragOver = function(e) {
        	if(this._draggingTarget){
        		// 分发config.EVENT.DRAGENTER事件
        		this._dispatchAgency(this._lastHover, u.DRAGOVER, e, this._draggingTarget)
        	}
        },
        /**
         * 拖拽离开目标元素
         * 
         * @private
         * @param {Object} event 事件对象
         */
        d.prototype._processDragLeave = function(e) {
            this._draggingTarget && this._dispatchAgency(this._lastHover, u.DRAGLEAVE, e, this._draggingTarget)
        },
        /**
         * 拖拽在目标元素上完成
         * 
         * @private
         * @param {Object} event 事件对象
         */
        d.prototype._processDrop = function(e) {
            this._draggingTarget && (this._draggingTarget.invisible = !1, this.storage.mod(this._draggingTarget.id), this.painter.refresh(), this._dispatchAgency(this._lastHover, u.DROP, e, this._draggingTarget))
        },
        /**
         * 拖拽结束
         * 
         * @private
         * @param {Object} event 事件对象
         */
        d.prototype._processDragEnd = function(e) {
            this._draggingTarget && (this._dispatchAgency(this._draggingTarget, u.DRAGEND, e), this._lastHover = null),
            this._isDragging = 0,
            this._draggingTarget = null
        },
        /**
         * 鼠标在某个图形元素上移动
         * 
         * @private
         * @param {Object} event 事件对象
         */
        d.prototype._processOverShape = function(e) {
            this._dispatchAgency(this._lastHover, u.MOUSEOVER, e)
        },
        /**
         * 鼠标离开某个图形元素
         * 
         * @private
         * @param {Object} event 事件对象
         */
        d.prototype._processOutShape = function(e) {
            this._dispatchAgency(this._lastHover, u.MOUSEOUT, e)
        },
        /**
         * 事件分发代理
         * 
         * @private
         * @param {Object} targetShape 目标图形元素
         * @param {string} eventName 事件名称
         * @param {Object} event 事件对象
         * @param {Object=} draggedShape 拖拽事件特有，当前被拖拽图形元素
         */
        d.prototype._dispatchAgency = function(e, t, n, r) {
            var i = "on" + t,
            s = {
                type: t,
                event: n,
                target: e,
                cancelBubble: !1
            },
            o = e;
            r && (s.dragged = r);
            while (o) {
                o[i] && (s.cancelBubble = o[i](s)),
                o.dispatch(t, s),
                o = o.parent;
                if (s.cancelBubble) break
            }
            if (e) {
            	// 冒泡到顶级 zrender 对象
            	if (!s.cancelBubble) {
            		this.dispatch(t, s);
                }
            }
            // 无hover目标，无拖拽对象，原生事件分发
            else if (!r) {
                var u = {
                    type: t,
                    event: n
                };
                this.dispatch(t, u),
            	// 分发事件到用户自定义层
                this.painter.eachOtherLayer(function(e) {
                    typeof e[i] == "function" && e[i](u),
                    e.dispatch && e.dispatch(t, u)
                })
            }
        },
        /**
         * 迭代寻找hover shape
         * @private
         * @method
         */
        d.prototype._iterateAndFindHover = function() {
            var e = o.create();
            return function() {
                var t = this.storage.getShapeList(),
                n,
                r,
                i = [0, 0];
                for (var u = t.length - 1; u >= 0; u--) {
                    var a = t[u];
                    n !== a.zlevel && (r = this.painter.getLayer(a.zlevel, r), i[0] = this._mouseX, i[1] = this._mouseY, r.needTransform && (o.invert(e, r.transform), s.applyTransform(i, i, e)));
                    if (this._findHover(a, i[0], i[1])) break
                }
            }
        } ();
        
        // touch指尖错觉的尝试偏移量配置
        var v = [{
            x: 10
        },
        {
            x: -20
        },
        {
            x: 10,
            y: 10
        },
        {
            y: -20
        }];
        // touch有指尖错觉，四向尝试，让touch上的点击更好触发事件
        return d.prototype._mobileFindFixed = function(e) {
            this._lastHover = null,
            this._mouseX = e.zrenderX,
            this._mouseY = e.zrenderY,
            this._event = e,
            this._iterateAndFindHover();
            for (var t = 0; ! this._lastHover && t < v.length; t++) {
                var n = v[t];
                n.x && (this._mouseX += n.x),
                n.y && (this._mouseY += n.y),
                this._iterateAndFindHover()
            }
            this._lastHover && (e.zrenderX = this._mouseX, e.zrenderY = this._mouseY)
        },
        /**
         * 如果存在第三方嵌入的一些dom触发的事件，或touch事件，需要转换一下事件坐标
         * @private
         */
        d.prototype._zrenderEventFixed = function(e, t) {
            if (e.zrenderFixed) return e;
            if (!t) {
                e = e || window.event;
                // 进入对象优先~
                var n = e.toElement || e.relatedTarget || e.srcElement || e.target;
                n && n != this._domHover && (e.zrenderX = (typeof e.offsetX != "undefined" ? e.offsetX: e.layerX) + n.offsetLeft, e.zrenderY = (typeof e.offsetY != "undefined" ? e.offsetY: e.layerY) + n.offsetTop)
            } else {
                var r = e.type != "touchend" ? e.targetTouches[0] : e.changedTouches[0];
                if (r) {
                    var i = this.painter._domRoot.getBoundingClientRect();
                    // touch事件坐标是全屏的~
                    e.zrenderX = r.clientX - i.left,
                    e.zrenderY = r.clientY - i.top
                }
            }
            return e.zrenderFixed = 1,
            e
        },
        i.merge(d.prototype, a.prototype, !0),
        d
    }),
    /**
     * 曲线辅助模块
     * @module zrender/tool/curve
     * @author pissang(https://www.github.com/pissang)
     */
    r("zrender/tool/curve", ["require", "./vector"], function(e) {
        function a(e) {
            return e > -n && e < n
        }
        function f(e) {
            return e > n || e < -n
        }
        /** 
         * 计算三次贝塞尔值
         * @memberOf module:zrender/tool/curve
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @param  {number} p3
         * @param  {number} t
         * @return {number}
         */
        function l(e, t, n, r, i) {
            var s = 1 - i;
            return s * s * (s * e + 3 * i * t) + i * i * (i * r + 3 * s * n)
        }
        /** 
         * 计算三次贝塞尔导数值
         * @memberOf module:zrender/tool/curve
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @param  {number} p3
         * @param  {number} t
         * @return {number}
         */
        function c(e, t, n, r, i) {
            var s = 1 - i;
            return 3 * (((t - e) * s + 2 * (n - t) * i) * s + (r - n) * i * i)
        }
        /**
         * 计算三次贝塞尔方程根，使用盛金公式
         * @memberOf module:zrender/tool/curve
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @param  {number} p3
         * @param  {number} val
         * @param  {Array.<number>} roots
         * @return {number} 有效根数目
         */
        function h(e, t, n, s, o, u) {
            var f = s + 3 * (t - n) - e,
            l = 3 * (n - t * 2 + e),
            c = 3 * (t - e),
            h = e - o,
            p = l * l - 3 * f * c,
            d = l * c - 9 * f * h,
            v = c * c - 3 * l * h,
            m = 0;
            if (a(p) && a(d)) if (a(l)) u[0] = 0;
            else {
                var g = -c / l;
                g >= 0 && g <= 1 && (u[m++] = g)
            } else {
                var y = d * d - 4 * p * v;
                if (a(y)) {
                    var b = d / p,
                    g = -l / f + b,
                    w = -b / 2;
                    g >= 0 && g <= 1 && (u[m++] = g),
                    w >= 0 && w <= 1 && (u[m++] = w)
                } else if (y > 0) {
                    var E = Math.sqrt(y),
                    S = p * l + 1.5 * f * ( - d + E),
                    x = p * l + 1.5 * f * ( - d - E);
                    S < 0 ? S = -Math.pow( - S, i) : S = Math.pow(S, i),
                    x < 0 ? x = -Math.pow( - x, i) : x = Math.pow(x, i);
                    var g = ( - l - (S + x)) / (3 * f);
                    g >= 0 && g <= 1 && (u[m++] = g)
                } else {
                    var T = (2 * p * l - 3 * f * d) / (2 * Math.sqrt(p * p * p)),
                    N = Math.acos(T) / 3,
                    C = Math.sqrt(p),
                    k = Math.cos(N),
                    g = ( - l - 2 * C * k) / (3 * f),
                    w = ( - l + C * (k + r * Math.sin(N))) / (3 * f),
                    L = ( - l + C * (k - r * Math.sin(N))) / (3 * f);
                    g >= 0 && g <= 1 && (u[m++] = g),
                    w >= 0 && w <= 1 && (u[m++] = w),
                    L >= 0 && L <= 1 && (u[m++] = L)
                }
            }
            return m
        }
        /**
         * 计算三次贝塞尔方程极限值的位置
         * @memberOf module:zrender/tool/curve
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @param  {number} p3
         * @param  {Array.<number>} extrema
         * @return {number} 有效数目
         */
        function p(e, t, n, r, i) {
            var s = 6 * n - 12 * t + 6 * e,
            o = 9 * t + 3 * r - 3 * e - 9 * n,
            u = 3 * t - 3 * e,
            l = 0;
            if (a(o)) {
                if (f(s)) {
                    var c = -u / s;
                    c >= 0 && c <= 1 && (i[l++] = c)
                }
            } else {
                var h = s * s - 4 * o * u;
                if (a(h)) i[0] = -s / (2 * o);
                else if (h > 0) {
                    var p = Math.sqrt(h),
                    c = ( - s + p) / (2 * o),
                    d = ( - s - p) / (2 * o);
                    c >= 0 && c <= 1 && (i[l++] = c),
                    d >= 0 && d <= 1 && (i[l++] = d)
                }
            }
            return l
        }
        /**
         * 细分三次贝塞尔曲线
         * @memberOf module:zrender/tool/curve
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @param  {number} p3
         * @param  {number} t
         * @param  {Array.<number>} out
         */
        function d(e, t, n, r, i, s) {
            var o = (t - e) * i + e,
            u = (n - t) * i + t,
            a = (r - n) * i + n,
            f = (u - o) * i + o,
            l = (a - u) * i + u,
            c = (l - f) * i + f;
            s[0] = e,
            s[1] = o,
            s[2] = f,
            s[3] = c,
            s[4] = c,
            s[5] = l,
            s[6] = a,
            s[7] = r
        }
        /**
         * 投射点到三次贝塞尔曲线上，返回投射距离。
         * 投射点有可能会有一个或者多个，这里只返回其中距离最短的一个。
         * @param {number} x0
         * @param {number} y0
         * @param {number} x1
         * @param {number} y1
         * @param {number} x2
         * @param {number} y2
         * @param {number} x3
         * @param {number} y3
         * @param {number} x
         * @param {number} y
         * @param {Array.<number>} [out] 投射点
         * @return {number}
         */
        function v(e, r, i, a, f, c, h, p, d, v, m) {
            var g, y = .005,
            b = Infinity;
            s[0] = d,
            s[1] = v;
            // 先粗略估计一下可能的最小距离的 t 值
            // PENDING
            for (var w = 0; w < 1; w += .05) {
                o[0] = l(e, i, f, h, w),
                o[1] = l(r, a, c, p, w);
                var E = t.distSquare(s, o);
                E < b && (g = w, b = E)
            }
            b = Infinity;
            // At most 32 iteration
            for (var S = 0; S < 32; S++) {
                if (y < n) break;
                var x = g - y,
                T = g + y;
                o[0] = l(e, i, f, h, x),
                o[1] = l(r, a, c, p, x);
                var E = t.distSquare(o, s);
                if (x >= 0 && E < b) g = x,
                b = E;
                else {
                    u[0] = l(e, i, f, h, T),
                    u[1] = l(r, a, c, p, T);
                    var N = t.distSquare(u, s);
                    T <= 1 && N < b ? (g = T, b = N) : y *= .5
                }
            }
            return m && (m[0] = l(e, i, f, h, g), m[1] = l(r, a, c, p, g)),
            Math.sqrt(b)
        }
        /**
         * 计算二次方贝塞尔值
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @param  {number} t
         * @return {number}
         */
        function m(e, t, n, r) {
            var i = 1 - r;
            return i * (i * e + 2 * r * t) + r * r * n
        }
        /**
         * 计算二次方贝塞尔导数值
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @param  {number} t
         * @return {number}
         */
        function g(e, t, n, r) {
            return 2 * ((1 - r) * (t - e) + r * (n - t))
        }
        /**
         * 计算二次方贝塞尔方程根
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @param  {number} t
         * @param  {Array.<number>} roots
         * @return {number} 有效根数目
         */
        function y(e, t, n, r, i) {
            var s = e - 2 * t + n,
            o = 2 * (t - e),
            u = e - r,
            l = 0;
            if (a(s)) {
                if (f(o)) {
                    var c = -u / o;
                    c >= 0 && c <= 1 && (i[l++] = c)
                }
            } else {
                var h = o * o - 4 * s * u;
                if (a(h)) {
                    var c = -o / (2 * s);
                    c >= 0 && c <= 1 && (i[l++] = c)
                } else if (h > 0) {
                    var p = Math.sqrt(h),
                    c = ( - o + p) / (2 * s),
                    d = ( - o - p) / (2 * s);
                    c >= 0 && c <= 1 && (i[l++] = c),
                    d >= 0 && d <= 1 && (i[l++] = d)
                }
            }
            return l
        }
        /**
         * 计算二次贝塞尔方程极限值
         * @memberOf module:zrender/tool/curve
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @return {number}
         */
        function b(e, t, n) {
            var r = e + n - 2 * t;
            if (r === 0) {
                return 0.5;
            }
            else {
                return (e - t) / r;
            }
        }
        /**
         * 细分二次贝塞尔曲线
         * @memberOf module:zrender/tool/curve
         * @param  {number} p0
         * @param  {number} p1
         * @param  {number} p2
         * @param  {number} t
         * @param  {Array.<number>} out
         */
        function w(e, t, n, r, i) {
            var s = (t - e) * r + e,
            o = (n - t) * r + t,
            u = (o - s) * r + s;
            i[0] = e,
            i[1] = s,
            i[2] = u,
            i[3] = u,
            i[4] = o,
            i[5] = n
        }
        /**
         * 投射点到二次贝塞尔曲线上，返回投射距离。
         * 投射点有可能会有一个或者多个，这里只返回其中距离最短的一个。
         * @param {number} x0
         * @param {number} y0
         * @param {number} x1
         * @param {number} y1
         * @param {number} x2
         * @param {number} y2
         * @param {number} x
         * @param {number} y
         * @param {Array.<number>} out 投射点
         * @return {number}
         */
        function E(e, r, i, a, f, l, c, h, p) {
            var d, v = .005,
            g = Infinity;
            s[0] = c,
            s[1] = h;
            for (var y = 0; y < 1; y += .05) {
                o[0] = m(e, i, f, y),
                o[1] = m(r, a, l, y);
                var b = t.distSquare(s, o);
                b < g && (d = y, g = b)
            }
            g = Infinity;
            for (var w = 0; w < 32; w++) {
                if (v < n) break;
                var E = d - v,
                S = d + v;
                o[0] = m(e, i, f, E),
                o[1] = m(r, a, l, E);
                var b = t.distSquare(o, s);
                if (E >= 0 && b < g) d = E,
                g = b;
                else {
                    u[0] = m(e, i, f, S),
                    u[1] = m(r, a, l, S);
                    var x = t.distSquare(u, s);
                    S <= 1 && x < g ? (d = S, g = x) : v *= .5
                }
            }
            return p && (p[0] = m(e, i, f, d), p[1] = m(r, a, l, d)),
            Math.sqrt(g)
        }
        var t = e("./vector"),
        n = 1e-4,
        r = Math.sqrt(3),
        i = 1 / 3,
        // 临时变量
        s = t.create(),
        o = t.create(),
        u = t.create();
        return {
            cubicAt: l,
            cubicDerivativeAt: c,
            cubicRootAt: h,
            cubicExtrema: p,
            cubicSubdivide: d,
            cubicProjectPoint: v,
            quadraticAt: m,
            quadraticDerivativeAt: g,
            quadraticRootAt: y,
            quadraticExtremum: b,
            quadraticSubdivide: w,
            quadraticProjectPoint: E
        }
    }),
    /**
     * zrender: 图形空间辅助类
     * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
     *         pissang (https://www.github.com/pissang)
     * isInside：是否在区域内部
     * isOutside：是否在区域外部
     * getTextWidth：测算单行文本宽度
     */
    r("zrender/tool/area", ["require", "./util", "./curve"], function(e) {
        function l(angle) {
        	angle %= PI2;
            if (angle < 0) {
                angle += PI2;
            }
            return angle;
            /*return e %= f,
            e < 0 && (e += f),
            e*/
        }
        /**
         * 包含判断
         * @param {Object} shape : 图形
         * @param {Object} area ： 目标区域
         * @param {number} x ： 横坐标
         * @param {number} y ： 纵坐标
         */
        function c(e, n, i, s) {
            if (!n || !e) return ! 1; // 无参数或不支持类型
            var o = e.type;
            r = r || t.getContext();
            // 未实现或不可用时(excanvas不支持)则数学运算，主要是line，polyline，ring
            var u = h(e, n, i, s);
            if (typeof u != "undefined") return u;
            if (e.buildPath && r.isPointInPath) return p(e, r, n, i, s);
            // 上面的方法都行不通时
            switch (o) {
	            case "ellipse": // Todo，不精确
	                return ! 0;
	             // 旋轮曲线  不准确
	            case "trochoid":
	                var a = n.location == "out" ? n.r1 + n.r2 + n.d: n.r1 - n.r2 + n.d;
	                return S(n, i, s, a);
	             // 玫瑰线 不准确
	            case "rose":
	                return S(n, i, s, n.maxr);
	            default:
	                return ! 1 // Todo，暂不支持
            }
        }
        /**
         * @param {Object} shape : 图形
         * @param {Object} area ：目标区域
         * @param {number} x ： 横坐标
         * @param {number} y ： 纵坐标
         * @return {boolean=} true表示坐标处在图形中
         */
        function h(e, t, n, r) {
            var i = e.type;
            // 在矩形内则部分图形需要进一步判断
            switch (i) {
            // 贝塞尔曲线
            case "bezier-curve":
                if (typeof t.cpX2 == "undefined") return g(t.xStart, t.yStart, t.cpX1, t.cpY1, t.xEnd, t.yEnd, t.lineWidth, n, r);
                return m(t.xStart, t.yStart, t.cpX1, t.cpY1, t.cpX2, t.cpY2, t.xEnd, t.yEnd, t.lineWidth, n, r);
             // 线
            case "line":
                return v(t.xStart, t.yStart, t.xEnd, t.yEnd, t.lineWidth, n, r);
             // 折线
            case "polyline":
                return b(t.pointList, t.lineWidth, n, r);
             // 圆环
            case "ring":
                return w(t.x, t.y, t.r0, t.r, n, r);
             // 圆形
            case "circle":
                return S(t.x, t.y, t.r, n, r);
             // 扇形
            case "sector":
                var s = t.startAngle * Math.PI / 180,
                o = t.endAngle * Math.PI / 180;
                return t.clockWise || (s = -s, o = -o),
                x(t.x, t.y, t.r0, t.r, s, o, !t.clockWise, n, r);
            // 多边形
            case "path":
                return t.pathArray && _(t.pathArray, Math.max(t.lineWidth, 5), t.brushType, n, r);
            case "polygon":
            case "star":
            case "isogon":
                return T(t.pointList, n, r);
            // 文本
            case "text":
                var u = t.__rect || e.getRect(t);
                return E(u.x, u.y, u.width, u.height, n, r);
            // 矩形
            case "rectangle":
        	// 图片
            case "image":
                return E(t.x, t.y, t.width, t.height, n, r)
            }
        }
        /**
         * 通过buildPath方法来判断，三个方法中较快，但是不支持线条类型的shape，
         * 而且excanvas不支持isPointInPath方法
         *
         * @param {Object} shape ： shape
         * @param {Object} context : 上下文
         * @param {Object} area ：目标区域
         * @param {number} x ： 横坐标
         * @param {number} y ： 纵坐标
         * @return {boolean} true表示坐标处在图形中
         */
        function p(e, t, n, r, i) {
        	// 图形类实现路径创建了则用类的path
            return t.beginPath(),
            e.buildPath(t, n),
            t.closePath(),
            t.isPointInPath(r, i)
        }
        /**
         * !isInside
         */
        function d(e, t, n, r) {
            return ! c(e, t, n, r)
        }
        /**
         * 线段包含判断
         * @param  {number}  x0
         * @param  {number}  y0
         * @param  {number}  x1
         * @param  {number}  y1
         * @param  {number}  lineWidth
         * @param  {number}  x
         * @param  {number}  y
         * @return {boolean}
         */
        function v(e, t, n, r, i, s, o) {
            if (i === 0) return ! 1;
            var u = Math.max(i, 5),
            a = 0,
            f = e;
            if (o > t + u && o > r + u || o < t - u && o < r - u || s > e + u && s > n + u || s < e - u && s < n - u) return ! 1;
            if (e === n) return Math.abs(s - e) <= u / 2;
            a = (t - r) / (e - n),
            f = (e * r - n * t) / (e - n);
            var l = a * s - o + f,
            c = l * l / (a * a + 1);
            return c <= u / 2 * u / 2
        }
        /**
         * 三次贝塞尔曲线描边包含判断
         * @param  {number}  x0
         * @param  {number}  y0
         * @param  {number}  x1
         * @param  {number}  y1
         * @param  {number}  x2
         * @param  {number}  y2
         * @param  {number}  x3
         * @param  {number}  y3
         * @param  {number}  lineWidth
         * @param  {number}  x
         * @param  {number}  y
         * @return {boolean}
         */
        function m(e, t, r, i, s, o, u, a, f, l, c) {
            if (f === 0) return ! 1;
            var h = Math.max(f, 5);
            if (c > t + h && c > i + h && c > o + h && c > a + h || c < t - h && c < i - h && c < o - h && c < a - h || l > e + h && l > r + h && l > s + h && l > u + h || l < e - h && l < r - h && l < s - h && l < u - h) return ! 1;
            var p = n.cubicProjectPoint(e, t, r, i, s, o, u, a, l, c, null);
            return p <= h / 2
        }
        /**
         * 二次贝塞尔曲线描边包含判断
         * @param  {number}  x0
         * @param  {number}  y0
         * @param  {number}  x1
         * @param  {number}  y1
         * @param  {number}  x2
         * @param  {number}  y2
         * @param  {number}  lineWidth
         * @param  {number}  x
         * @param  {number}  y
         * @return {boolean}
         */
        function g(e, t, r, i, s, o, u, a, f) {
            if (u === 0) return ! 1;
            var l = Math.max(u, 5);
            if (f > t + l && f > i + l && f > o + l || f < t - l && f < i - l && f < o - l || a > e + l && a > r + l && a > s + l || a < e - l && a < r - l && a < s - l) return ! 1;
            var c = n.quadraticProjectPoint(e, t, r, i, s, o, a, f, null);
            return c <= l / 2
        }
        /**
         * 圆弧描边包含判断
         * @param  {number}  cx
         * @param  {number}  cy
         * @param  {number}  r
         * @param  {number}  startAngle
         * @param  {number}  endAngle
         * @param  {boolean}  anticlockwise
         * @param  {number} lineWidth
         * @param  {number}  x
         * @param  {number}  y
         * @return {Boolean}
         */
        function y(e, t, n, r, i, s, o, u, a) {
            if (o === 0) return ! 1;
            var c = Math.max(o, 5);
            u -= e,
            a -= t;
            var h = Math.sqrt(u * u + a * a);
            if (h - c > n || h + c < n) return ! 1;
            if (Math.abs(r - i) >= f) return ! 0;
            if (s) {
                var p = r;
                r = l(i),
                i = l(p)
            } else r = l(r),
            i = l(i);
            r > i && (i += f);
            var d = Math.atan2(a, u);
            return d < 0 && (d += f),
            d >= r && d <= i || d + f >= r && d + f <= i
        }
        function b(e, t, n, r) {
            var t = Math.max(t, 10);
            for (var i = 0,
            s = e.length - 1; i < s; i++) {
                var o = e[i][0],
                u = e[i][1],
                a = e[i + 1][0],
                f = e[i + 1][1];
                if (v(o, u, a, f, t, n, r)) return ! 0
            }
            return ! 1
        }
        function w(e, t, n, r, i, s) {
            var o = (i - e) * (i - e) + (s - t) * (s - t);
            return o < r * r && o > n * n
        }
        /**
         * 矩形包含判断
         */
        function E(e, t, n, r, i, s) {
            return i >= e && i <= e + n && s >= t && s <= t + r
        }
        /**
         * 圆形包含判断
         */
        function S(e, t, n, r, i) {
            return (r - e) * (r - e) + (i - t) * (i - t) < n * n
        }
        /**
         * 扇形包含判断
         */
        function x(e, t, n, r, i, s, o, u, a) {
            return y(e, t, (n + r) / 2, i, s, o, r - n, u, a)
        }
        /**
         * 多边形包含判断
         * 与 canvas 一样采用 non-zero winding rule
         */
        function T(e, t, n) {
            var r = e.length,
            i = 0;
            for (var s = 0,
            o = r - 1; s < r; s++) {
                var u = e[o][0],
                a = e[o][1],
                f = e[s][0],
                l = e[s][1];
                i += N(u, a, f, l, t, n),
                o = s
            }
            return i !== 0
        }
        function N(e, t, n, r, i, s) {
            if (s > t && s > r || s < t && s < r) return 0;
            if (r == t) return 0;
            var o = r < t ? 1 : -1,
            u = (s - t) / (r - t),
            a = u * (n - e) + e;
            return a > i ? o: 0
        }
        function L() {
            var e = k[0];
            k[0] = k[1],
            k[1] = e
        }
        function A(e, t, r, i, s, o, u, a, f, l) {
            if (l > t && l > i && l > o && l > a || l < t && l < i && l < o && l < a) return 0;
            var c = n.cubicRootAt(t, i, o, a, l, C);
            if (c === 0) return 0;
            var h = 0,
            p = -1,
            d, v;
            for (var m = 0; m < c; m++) {
                var g = C[m],
                y = n.cubicAt(e, r, s, u, g);
                if (y < f) continue;
                p < 0 && (p = n.cubicExtrema(t, i, o, a, k), k[1] < k[0] && p > 1 && L(), d = n.cubicAt(t, i, o, a, k[0]), p > 1 && (v = n.cubicAt(t, i, o, a, k[1]))),
                p == 2 ? g < k[0] ? h += d < t ? 1 : -1 : g < k[1] ? h += v < d ? 1 : -1 : h += a < v ? 1 : -1 : g < k[0] ? h += d < t ? 1 : -1 : h += a < d ? 1 : -1
            }
            return h
        }
        function O(e, t, r, i, s, o, u, a) {
            if (a > t && a > i && a > o || a < t && a < i && a < o) return 0;
            var f = n.quadraticRootAt(t, i, o, a, C);
            if (f === 0) return 0;
            var l = n.quadraticExtremum(t, i, o);
            if (l >= 0 && l <= 1) {
                var c = 0,
                h = n.quadraticAt(t, i, o, l);
                for (var p = 0; p < f; p++) {
                    var d = n.quadraticAt(e, r, s, C[p]);
                    if (d > u) continue;
                    C[p] < l ? c += h < t ? 1 : -1 : c += o < h ? 1 : -1
                }
                return c
            }
            var d = n.quadraticAt(e, r, s, C[0]);
            return d > u ? 0 : o < t ? 1 : -1
        }
        function M(e, t, n, r, i, s, o, u) {
            u -= t;
            if (u > n || u < -n) return 0;
            var a = Math.sqrt(n * n - u * u);
            C[0] = -a,
            C[1] = a;
            if (Math.abs(r - i) >= f) {
                r = 0,
                i = f;
                var c = s ? 1 : -1;
                return o >= C[0] + e && o <= C[1] + e ? c: 0
            }
            if (s) {
                var a = r;
                r = l(i),
                i = l(a)
            } else r = l(r),
            i = l(i);
            r > i && (i += f);
            var h = 0;
            for (var p = 0; p < 2; p++) {
                var d = C[p];
                if (d + e > o) {
                    var v = Math.atan2(u, d),
                    c = s ? 1 : -1;
                    v < 0 && (v = f + v);
                    if (v >= r && v <= i || v + f >= r && v + f <= i) v > Math.PI / 2 && v < Math.PI * 1.5 && (c = -c),
                    h += c
                }
            }
            return h
        }
        function _(e, t, n, r, i) {
            var s = 0,
            o = 0,
            u = 0,
            a = 0,
            f = 0,
            l = !0,
            c = !0;
            n = n || "fill";
            var h = n === "stroke" || n === "both",
            p = n === "fill" || n === "both";
            for (var d = 0; d < e.length; d++) {
                var b = e[d],
                w = b.points;
                if (l || b.command === "M") {
                    if (d > 0) {
                        p && (s += N(o, u, a, f, r, i));
                        if (s !== 0) return ! 0
                    }
                    a = w[w.length - 2],
                    f = w[w.length - 1],
                    l = !1,
                    c && b.command !== "A" && (c = !1, o = a, u = f)
                }
                switch (b.command) {
                case "M":
                    o = w[0],
                    u = w[1];
                    break;
                case "L":
                    if (h && v(o, u, w[0], w[1], t, r, i)) return ! 0;
                    p && (s += N(o, u, w[0], w[1], r, i)),
                    o = w[0],
                    u = w[1];
                    break;
                case "C":
                    if (h && m(o, u, w[0], w[1], w[2], w[3], w[4], w[5], t, r, i)) return ! 0;
                    p && (s += A(o, u, w[0], w[1], w[2], w[3], w[4], w[5], r, i)),
                    o = w[4],
                    u = w[5];
                    break;
                case "Q":
                    if (h && g(o, u, w[0], w[1], w[2], w[3], t, r, i)) return ! 0;
                    p && (s += O(o, u, w[0], w[1], w[2], w[3], r, i)),
                    o = w[2],
                    u = w[3];
                    break;
                case "A":
                    var E = w[0],
                    S = w[1],
                    x = w[2],
                    T = w[3],
                    C = w[4],
                    k = w[5],
                    L = Math.cos(C) * x + E,
                    _ = Math.sin(C) * T + S;
                    c ? (c = !1, a = L, f = _) : s += N(o, u, L, _);
                    var D = (r - E) * T / x + E;
                    if (h && y(E, S, T, C, C + k, 1 - w[7], t, D, i)) return ! 0;
                    p && (s += M(E, S, T, C, C + k, 1 - w[7], D, i)),
                    o = Math.cos(C + k) * x + E,
                    u = Math.sin(C + k) * T + S;
                    break;
                case "z":
                    if (h && v(o, u, a, f, t, r, i)) return ! 0;
                    l = !0
                }
            }
            return p && (s += N(o, u, a, f, r, i)),
            s !== 0
        }
        function D(e, n) {
            var s = e + ":" + n;
            if (i[s]) return i[s];
            r = r || t.getContext(),
            r.save(),
            n && (r.font = n),
            e = (e + "").split("\n");
            var u = 0;
            for (var f = 0,
            l = e.length; f < l; f++) u = Math.max(r.measureText(e[f]).width, u);
            return r.restore(),
            i[s] = u,
            ++o > a && (o = 0, i = {}),
            u
        }
        function P(e, n) {
            var i = e + ":" + n;
            if (s[i]) return s[i];
            r = r || t.getContext(),
            r.save(),
            n && (r.font = n),
            e = (e + "").split("\n");
            var o = (r.measureText("国").width + 2) * e.length;
            return r.restore(),
            s[i] = o,
            ++u > a && (u = 0, s = {}),
            o
        }
        var t = e("./util"),
        n = e("./curve"),
        r,
        i = {},
        s = {},
        o = 0,
        u = 0,
        a = 5e3,
        f = Math.PI * 2,
        // 临时数组
        C = [ - 1, -1, -1],
        k = [ - 1, -1];
        return {
            isInside: c,
            isOutside: d,
            getTextWidth: D,
            getTextHeight: P,
            isInsidePath: _,
            isInsidePolygon: T,
            isInsideSector: x,
            isInsideCircle: S,
            isInsideLine: v,
            isInsideRect: E,
            isInsidePolyline: b,
            isInsideCubicStroke: m,
            isInsideQuadraticStroke: g
        }
    }),
    //提供变换扩展
    r("zrender/mixin/Transformable", ["require", "../tool/matrix", "../tool/vector"], function(e) {
        function o(e) {
            return e > -s && e < s
        }
        function u(e) {
            return e > s || e < -s
        }
        var t = e("../tool/matrix"),
        n = e("../tool/vector"),
        r = [0, 0],
        i = t.translate,
        s = 5e-5,
        a = function() {
            this.position || (this.position = [0, 0]),//position平移
            typeof this.rotation == "undefined" && (this.rotation = [0, 0, 0]),//rotation旋转，可以通过数组二三项指定旋转的原点
            this.scale || (this.scale = [1, 1, 0, 0]),//scale  Array.<number>缩放，可以通过数组三四项指定缩放的原点默认值[1, 1, 0, 0]
            this.needLocalTransform = !1,
            this.needTransform = !1//needTransform是否有坐标变换
        };
        return a.prototype = {
            constructor: a,
            updateNeedTransform: function() {
                this.needLocalTransform = u(this.rotation[0]) || u(this.position[0]) || u(this.position[1]) || u(this.scale[0] - 1) || u(this.scale[1] - 1)
            },
            updateTransform: function() {//判断是否需要有坐标变换，更新needTransform属性。 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵
                this.updateNeedTransform();
                var e = this.parent && this.parent.needTransform;
                this.needTransform = this.needLocalTransform || e;
                if (!this.needTransform) return;
                var n = this.transform || t.create();
                t.identity(n);
                if (this.needLocalTransform) {
                    var s = this.scale;
                    if (u(s[0]) || u(s[1])) {
                        r[0] = -s[2] || 0,
                        r[1] = -s[3] || 0;
                        var o = u(r[0]) || u(r[1]);
                        o && i(n, n, r),
                        t.scale(n, n, s),
                        o && (r[0] = -r[0], r[1] = -r[1], i(n, n, r))
                    }
                    if (this.rotation instanceof Array) {
                        if (this.rotation[0] !== 0) {
                            r[0] = -this.rotation[1] || 0,
                            r[1] = -this.rotation[2] || 0;
                            var o = u(r[0]) || u(r[1]);
                            o && i(n, n, r),
                            t.rotate(n, n, this.rotation[0]),
                            o && (r[0] = -r[0], r[1] = -r[1], i(n, n, r))
                        }
                    } else this.rotation !== 0 && t.rotate(n, n, this.rotation); (u(this.position[0]) || u(this.position[1])) && i(n, n, this.position)
                }
                e && (this.needLocalTransform ? t.mul(n, this.parent.transform, n) : t.copy(n, this.parent.transform)),
                this.transform = n,
                this.invTransform = this.invTransform || t.create(),
                t.invert(this.invTransform, n)
            },
            //将自己的transform应用到context上
            setTransform: function(e) {
                if (this.needTransform) {
                    var t = this.transform;
                    e.transform(t[0], t[1], t[2], t[3], t[4], t[5])
                }
            },
            //设置图形的朝向
            lookAt: function() {
                var e = n.create();
                return function(r) {
                    this.transform || (this.transform = t.create());
                    var i = this.transform;
                    n.sub(e, r, this.position);
                    if (o(e[0]) && o(e[1])) return;
                    n.normalize(e, e);
                    var s = this.scale;
                    i[2] = e[0] * scal[1],
                    i[3] = e[1] * scal[1],
                    i[0] = e[1] * scal[0],
                    i[1] = -e[0] * scal[0],
                    i[4] = this.position[0],
                    i[5] = this.position[1],
                    this.decomposeTransform()
                }
            } (),
            //分解transform矩阵到position, rotation, scale
            decomposeTransform: function() {
                if (!this.transform) return;
                var e = this.transform,
                t = e[0] * e[0] + e[1] * e[1],
                n = this.position,
                r = this.scale,
                i = this.rotation;
                u(t - 1) && (t = Math.sqrt(t));
                var s = e[2] * e[2] + e[3] * e[3];
                u(s - 1) && (s = Math.sqrt(s)),
                n[0] = e[4],
                n[1] = e[5],
                r[0] = t,
                r[1] = s,
                r[2] = r[3] = 0,
                i[0] = Math.atan2( - e[1] / s, e[0] / t),
                i[1] = i[2] = 0
            },
            //变换坐标位置到 shape 的局部坐标空间
            transformCoordToLocal: function(e, n) {
                var r = [e, n];
                return this.needTransform && this.invTransform && t.mulVector(r, this.invTransform, r),
                r
            }
        },
        a
    }),
    //颜色辅助模块
    r("zrender/tool/color", ["require", "../tool/util"], function(e) {
    	/**
         * 自定义调色板
         */
        function f(e) {
            r = e
        }
        /**
         * 复位默认色板
         */
        function l() {
            r = i
        }
        /**
         * 获取色板颜色
         * @memberOf module:zrender/tool/color
         * @param {number} idx 色板位置
         * @param {Array.<string>} [userPalete] 自定义色板
         * @return {string} 颜色
         */
        function c(e, t) {
            return e |= 0,
            t = t || r,
            t[e % t.length]
        }
        /**
         * 自定义默认高亮颜色
         */
        function h(e) {
            s = e
        }
        /**
         * 重置默认高亮颜色
         */
        function p() {
            o = s
        }
        /**
         * 获取默认高亮颜色
         */
        function d() {
            return s
        }
        /**
         * 径向渐变
         * @memberOf module:zrender/tool/color
         * @param {number} x0 渐变起点
         * @param {number} y0
         * @param {number} r0
         * @param {number} x1 渐变终点
         * @param {number} y1
         * @param {number} r1
         * @param {Array} colorList 颜色列表
         * @return {CanvasGradient}
         */
        function v(e, r, i, s, o, u, a) {
            n || (n = t.getContext());
            var f = n.createRadialGradient(e, r, i, s, o, u);
            for (var l = 0,
            c = a.length; l < c; l++) f.addColorStop(a[l][0], a[l][1]);
            return f.__nonRecursion = !0,
            f
        }
        /**
         * 线性渐变
         * @param {Object} x0 渐变起点
         * @param {Object} y0
         * @param {Object} x1 渐变终点
         * @param {Object} y1
         * @param {Array} colorList 颜色列表
         */
        function m(e, r, i, s, o) {
            n || (n = t.getContext());
            var u = n.createLinearGradient(e, r, i, s);
            for (var a = 0,
            f = o.length; a < f; a++) u.addColorStop(o[a][0], o[a][1]);
            return u.__nonRecursion = !0,
            u
        }
        /**
         * 获取两种颜色之间渐变颜色数组
         * @param {color} start 起始颜色
         * @param {color} end 结束颜色
         * @param {number} step 渐变级数
         * @return {Array}  颜色数组
         */
        function g(e, t, n) {
            e = S(e),
            t = S(t),
            e = F(e),
            t = F(t);
            var r = [],
            i = (t[0] - e[0]) / n,
            s = (t[1] - e[1]) / n,
            o = (t[2] - e[2]) / n,
            u = (t[3] - e[3]) / n;
            for (var a = 0,
            f = e[0], l = e[1], c = e[2], h = e[3]; a < n; a++) r[a] = b([R(Math.floor(f), [0, 255]), R(Math.floor(l), [0, 255]), R(Math.floor(c), [0, 255]), h.toFixed(4) - 0], "rgba"),
            f += i,
            l += s,
            c += o,
            h += u;
            return f = t[0],
            l = t[1],
            c = t[2],
            h = t[3],
            r[a] = b([f, l, c, h], "rgba"),
            r
        }
        /**
         * 获取指定级数的渐变颜色数组
         * @memberOf module:zrender/tool/color
         * @param {Array.<string>} colors 颜色组
         * @param {number} [step=20] 渐变级数
         * @return {Array.<string>}  颜色数组
         */
        function y(e, t) {
            var n = [],
            r = e.length;
            t === undefined && (t = 20);
            if (r === 1) n = g(e[0], e[0], t);
            else if (r > 1) for (var i = 0,
            s = r - 1; i < s; i++) {
                var o = g(e[i], e[i + 1], t);
                i < s - 1 && o.pop(),
                n = n.concat(o)
            }
            return n
        }
        /**
         * 颜色值数组转为指定格式颜色,例如:<br/>
         * data = [60,20,20,0.1] format = 'rgba'
         * 返回：rgba(60,20,20,0.1)
         * @param {Array} data 颜色值数组
         * @param {string} format 格式,默认rgb
         * @return {string} 颜色
         */
        function b(e, t) {
            t = t || "rgb";
            if (e && (e.length === 3 || e.length === 4)) {
                e = q(e,
                function(e) {
                    return e > 1 ? Math.ceil(e) : e
                });
                if (t.indexOf("hex") > -1) return "#" + ((1 << 24) + (e[0] << 16) + (e[1] << 8) + +e[2]).toString(16).slice(1);
                if (t.indexOf("hs") > -1) {
                    var n = q(e.slice(1, 3),
                    function(e) {
                        return e + "%"
                    });
                    e[1] = n[0],
                    e[2] = n[1]
                }
                return t.indexOf("a") > -1 ? (e.length === 3 && e.push(1), e[3] = R(e[3], [0, 1]), t + "(" + e.slice(0, 4).join(",") + ")") : t + "(" + e.slice(0, 3).join(",") + ")"
            }
        }
        /**
         * 颜色字符串转换为rgba数组
         * @memberOf module:zrender/tool/color
         * @param {string} color 颜色
         * @return {Array.<number>} 颜色值数组
         */
        function w(e) {
            e = _(e),
            e.indexOf("rgba") < 0 && (e = S(e));
            var t = [],
            n = 0;
            return e.replace(/[\d.]+/g,
            function(e) {
                n < 3 ? e |= 0 : e = +e,
                t[n++] = e
            }),
            t
        }
        /**
         * 颜色格式转化
         *
         * @param {string} color 颜色值数组
         * @param {string} format 格式,默认rgb
         * @return {string} 颜色
         */
        function E(e, t) {
            if (!U(e)) return e;
            var n = F(e),
            r = n[3];
            return typeof r == "undefined" && (r = 1),
            e.indexOf("hsb") > -1 ? n = z(n) : e.indexOf("hsl") > -1 && (n = W(n)),
            t.indexOf("hsb") > -1 || t.indexOf("hsv") > -1 ? n = V(n) : t.indexOf("hsl") > -1 && (n = $(n)),
            n[3] = r,
            b(n, t)
        }
        /**
         * 转换为rgba格式的颜色
         * @memberOf module:zrender/tool/color
         * @param {string} color 颜色
         * @return {string} rgba颜色，rgba(r,g,b,a)
         */
        function S(e) {
            return E(e, "rgba")
        }
        /**
         * 转换为rgb数字格式的颜色
         * @memberOf module:zrender/tool/color
         * @param {string} color 颜色
         * @return {string} rgb颜色，rgb(0,0,0)格式
         */
        function x(e) {
            return E(e, "rgb")
        }
        /**
         * 转换为16进制颜色
         * @memberOf module:zrender/tool/color
         * @param {string} color 颜色
         * @return {string} 16进制颜色，#rrggbb格式
         */
        function T(e) {
            return E(e, "hex")
        }
        /**
         * 转换为HSV颜色
         * @memberOf module:zrender/tool/color
         * @param {string} color 颜色
         * @return {string} HSVA颜色，hsva(h,s,v,a)
         */
        function N(e) {
            return E(e, "hsva")
        }
        function C(e) {
            return E(e, "hsv")
        }
        function k(e) {
            return E(e, "hsba")
        }
        function L(e) {
            return E(e, "hsb")
        }
        function A(e) {
            return E(e, "hsla")
        }
        function O(e) {
            return E(e, "hsl")
        }
        function M(e) {
            for (var t in a) if (T(a[t]) === T(e)) return t;
            return null
        }
        /**
         * 移除颜色中多余空格
         * 
         * @param {string} color 颜色
         * @return {string} 无空格颜色
         */
        function _(e) {
            return String(e).replace(/\s+/g, "")
        }
        function D(e) {
            a[e] && (e = a[e]),
            e = _(e),
            e = e.replace(/hsv/i, "hsb");
            if (/^#[\da-f]{3}$/i.test(e)) {
                e = parseInt(e.slice(1), 16);
                var t = (e & 3840) << 8,
                n = (e & 240) << 4,
                r = e & 15;
                e = "#" + ((1 << 24) + (t << 4) + t + (n << 4) + n + (r << 4) + r).toString(16).slice(1)
            }
            return e
        }
        function P(e, t) {
            if (!U(e)) return e;
            var n = t > 0 ? 1 : -1;
            typeof t == "undefined" && (t = 0),
            t = Math.abs(t) > 1 ? 1 : Math.abs(t),
            e = x(e);
            var r = F(e);
            for (var i = 0; i < 3; i++) n === 1 ? r[i] = r[i] * (1 - t) | 0 : r[i] = (255 - r[i]) * t + r[i] | 0;
            return "rgb(" + r.join(",") + ")"
        }
        function H(e) {
            if (!U(e)) return e;
            var t = F(S(e));
            return t = q(t,
            function(e) {
                return 255 - e
            }),
            b(t, "rgb")
        }
        function B(e, t, n) {
            if (!U(e) || !U(t)) return e;
            typeof n == "undefined" && (n = .5),
            n = 1 - R(n, [0, 1]);
            var r = n * 2 - 1,
            i = F(S(e)),
            s = F(S(t)),
            o = i[3] - s[3],
            u = ((r * o === -1 ? r: (r + o) / (1 + r * o)) + 1) / 2,
            a = 1 - u,
            f = [];
            for (var l = 0; l < 3; l++) f[l] = i[l] * u + s[l] * a;
            var c = i[3] * n + s[3] * (1 - n);
            return c = Math.max(0, Math.min(1, c)),
            i[3] === 1 && s[3] === 1 ? b(f, "rgb") : (f[3] = c, b(f, "rgba"))
        }
        function j() {
            return "#" + (Math.random().toString(16) + "0000").slice(2, 8)
        }
        function F(e) {
            e = D(e);
            var t = e.match(u);
            if (t === null) throw new Error("The color format error");
            var n, r, i = [],
            s;
            if (t[2]) n = t[2].replace("#", "").split(""),
            s = [n[0] + n[1], n[2] + n[3], n[4] + n[5]],
            i = q(s,
            function(e) {
                return R(parseInt(e, 16), [0, 255])
            });
            else if (t[4]) {
                var o = t[4].split(",");
                r = o[3],
                s = o.slice(0, 3),
                i = q(s,
                function(e) {
                    return e = Math.floor(e.indexOf("%") > 0 ? parseInt(e, 0) * 2.55 : e),
                    R(e, [0, 255])
                }),
                typeof r != "undefined" && i.push(R(parseFloat(r), [0, 1]))
            } else if (t[5] || t[6]) {
                var a = (t[5] || t[6]).split(","),
                f = parseInt(a[0], 0) / 360,
                l = a[1],
                c = a[2];
                r = a[3],
                i = q([l, c],
                function(e) {
                    return R(parseFloat(e) / 100, [0, 1])
                }),
                i.unshift(f),
                typeof r != "undefined" && i.push(R(parseFloat(r), [0, 1]))
            }
            return i
        }
        function I(e, t) {
            if (!U(e)) return e;
            t === null && (t = 1);
            var n = F(S(e));
            return n[3] = R(Number(t).toFixed(4), [0, 1]),
            b(n, "rgba")
        }
        function q(e, t) {
            if (typeof t != "function") throw new TypeError;
            var n = e ? e.length: 0;
            for (var r = 0; r < n; r++) e[r] = t(e[r]);
            return e
        }
        function R(e, t) {
            return e <= t[0] ? e = t[0] : e >= t[1] && (e = t[1]),
            e
        }
        function U(e) {
            return e instanceof Array || typeof e == "string"
        }
        function z(e) {
            var t = e[0],
            n = e[1],
            r = e[2],
            i,
            s,
            o;
            if (n === 0) i = r * 255,
            s = r * 255,
            o = r * 255;
            else {
                var u = t * 6;
                u === 6 && (u = 0);
                var a = u | 0,
                f = r * (1 - n),
                l = r * (1 - n * (u - a)),
                c = r * (1 - n * (1 - (u - a))),
                h = 0,
                p = 0,
                d = 0;
                a === 0 ? (h = r, p = c, d = f) : a === 1 ? (h = l, p = r, d = f) : a === 2 ? (h = f, p = r, d = c) : a === 3 ? (h = f, p = l, d = r) : a === 4 ? (h = c, p = f, d = r) : (h = r, p = f, d = l),
                i = h * 255,
                s = p * 255,
                o = d * 255
            }
            return [i, s, o]
        }
        function W(e) {
            var t = e[0],
            n = e[1],
            r = e[2],
            i,
            s,
            o;
            if (n === 0) i = r * 255,
            s = r * 255,
            o = r * 255;
            else {
                var u;
                r < .5 ? u = r * (1 + n) : u = r + n - n * r;
                var a = 2 * r - u;
                i = 255 * X(a, u, t + 1 / 3),
                s = 255 * X(a, u, t),
                o = 255 * X(a, u, t - 1 / 3)
            }
            return [i, s, o]
        }
        function X(e, t, n) {
            return n < 0 && (n += 1),
            n > 1 && (n -= 1),
            6 * n < 1 ? e + (t - e) * 6 * n: 2 * n < 1 ? t: 3 * n < 2 ? e + (t - e) * (2 / 3 - n) * 6 : e
        }
        function V(e) {
            var t = e[0] / 255,
            n = e[1] / 255,
            r = e[2] / 255,
            i = Math.min(t, n, r),
            s = Math.max(t, n, r),
            o = s - i,
            u = s,
            a,
            f;
            if (o === 0) a = 0,
            f = 0;
            else {
                f = o / s;
                var l = ((s - t) / 6 + o / 2) / o,
                c = ((s - n) / 6 + o / 2) / o,
                h = ((s - r) / 6 + o / 2) / o;
                t === s ? a = h - c: n === s ? a = 1 / 3 + l - h: r === s && (a = 2 / 3 + c - l),
                a < 0 && (a += 1),
                a > 1 && (a -= 1)
            }
            return a *= 360,
            f *= 100,
            u *= 100,
            [a, f, u]
        }
        function $(e) {
            var t = e[0] / 255,
            n = e[1] / 255,
            r = e[2] / 255,
            i = Math.min(t, n, r),
            s = Math.max(t, n, r),
            o = s - i,
            u = (s + i) / 2,
            a,
            f;
            if (o === 0) a = 0,
            f = 0;
            else {
                u < .5 ? f = o / (s + i) : f = o / (2 - s - i);
                var l = ((s - t) / 6 + o / 2) / o,
                c = ((s - n) / 6 + o / 2) / o,
                h = ((s - r) / 6 + o / 2) / o;
                t === s ? a = h - c: n === s ? a = 1 / 3 + l - h: r === s && (a = 2 / 3 + c - l),
                a < 0 && (a += 1),
                a > 1 && (a -= 1)
            }
            return a *= 360,
            f *= 100,
            u *= 100,
            [a, f, u]
        }
        var t = e("../tool/util"),
        n,
        r = ["#ff9277", " #dddd00", " #ffc877", " #bbe3ff", " #d5ffbb", "#bbbbff", " #ddb000", " #b0dd00", " #e2bbff", " #ffbbe3", "#ff7777", " #ff9900", " #83dd00", " #77e3ff", " #778fff", "#c877ff", " #ff77ab", " #ff6600", " #aa8800", " #77c7ff", "#ad77ff", " #ff77ff", " #dd0083", " #777700", " #00aa00", "#0088aa", " #8400dd", " #aa0088", " #dd0000", " #772e00"],
        i = r,
        s = "rgba(255,255,0,0.5)",
        o = s,
        u = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,
        a = {
            aliceblue: "#f0f8ff",
            antiquewhite: "#faebd7",
            aqua: "#0ff",
            aquamarine: "#7fffd4",
            azure: "#f0ffff",
            beige: "#f5f5dc",
            bisque: "#ffe4c4",
            black: "#000",
            blanchedalmond: "#ffebcd",
            blue: "#00f",
            blueviolet: "#8a2be2",
            brown: "#a52a2a",
            burlywood: "#deb887",
            cadetblue: "#5f9ea0",
            chartreuse: "#7fff00",
            chocolate: "#d2691e",
            coral: "#ff7f50",
            cornflowerblue: "#6495ed",
            cornsilk: "#fff8dc",
            crimson: "#dc143c",
            cyan: "#0ff",
            darkblue: "#00008b",
            darkcyan: "#008b8b",
            darkgoldenrod: "#b8860b",
            darkgray: "#a9a9a9",
            darkgrey: "#a9a9a9",
            darkgreen: "#006400",
            darkkhaki: "#bdb76b",
            darkmagenta: "#8b008b",
            darkolivegreen: "#556b2f",
            darkorange: "#ff8c00",
            darkorchid: "#9932cc",
            darkred: "#8b0000",
            darksalmon: "#e9967a",
            darkseagreen: "#8fbc8f",
            darkslateblue: "#483d8b",
            darkslategray: "#2f4f4f",
            darkslategrey: "#2f4f4f",
            darkturquoise: "#00ced1",
            darkviolet: "#9400d3",
            deeppink: "#ff1493",
            deepskyblue: "#00bfff",
            dimgray: "#696969",
            dimgrey: "#696969",
            dodgerblue: "#1e90ff",
            firebrick: "#b22222",
            floralwhite: "#fffaf0",
            forestgreen: "#228b22",
            fuchsia: "#f0f",
            gainsboro: "#dcdcdc",
            ghostwhite: "#f8f8ff",
            gold: "#ffd700",
            goldenrod: "#daa520",
            gray: "#808080",
            grey: "#808080",
            green: "#008000",
            greenyellow: "#adff2f",
            honeydew: "#f0fff0",
            hotpink: "#ff69b4",
            indianred: "#cd5c5c",
            indigo: "#4b0082",
            ivory: "#fffff0",
            khaki: "#f0e68c",
            lavender: "#e6e6fa",
            lavenderblush: "#fff0f5",
            lawngreen: "#7cfc00",
            lemonchiffon: "#fffacd",
            lightblue: "#add8e6",
            lightcoral: "#f08080",
            lightcyan: "#e0ffff",
            lightgoldenrodyellow: "#fafad2",
            lightgray: "#d3d3d3",
            lightgrey: "#d3d3d3",
            lightgreen: "#90ee90",
            lightpink: "#ffb6c1",
            lightsalmon: "#ffa07a",
            lightseagreen: "#20b2aa",
            lightskyblue: "#87cefa",
            lightslategray: "#789",
            lightslategrey: "#789",
            lightsteelblue: "#b0c4de",
            lightyellow: "#ffffe0",
            lime: "#0f0",
            limegreen: "#32cd32",
            linen: "#faf0e6",
            magenta: "#f0f",
            maroon: "#800000",
            mediumaquamarine: "#66cdaa",
            mediumblue: "#0000cd",
            mediumorchid: "#ba55d3",
            mediumpurple: "#9370d8",
            mediumseagreen: "#3cb371",
            mediumslateblue: "#7b68ee",
            mediumspringgreen: "#00fa9a",
            mediumturquoise: "#48d1cc",
            mediumvioletred: "#c71585",
            midnightblue: "#191970",
            mintcream: "#f5fffa",
            mistyrose: "#ffe4e1",
            moccasin: "#ffe4b5",
            navajowhite: "#ffdead",
            navy: "#000080",
            oldlace: "#fdf5e6",
            olive: "#808000",
            olivedrab: "#6b8e23",
            orange: "#ffa500",
            orangered: "#ff4500",
            orchid: "#da70d6",
            palegoldenrod: "#eee8aa",
            palegreen: "#98fb98",
            paleturquoise: "#afeeee",
            palevioletred: "#d87093",
            papayawhip: "#ffefd5",
            peachpuff: "#ffdab9",
            peru: "#cd853f",
            pink: "#ffc0cb",
            plum: "#dda0dd",
            powderblue: "#b0e0e6",
            purple: "#800080",
            red: "#f00",
            rosybrown: "#bc8f8f",
            royalblue: "#4169e1",
            saddlebrown: "#8b4513",
            salmon: "#fa8072",
            sandybrown: "#f4a460",
            seagreen: "#2e8b57",
            seashell: "#fff5ee",
            sienna: "#a0522d",
            silver: "#c0c0c0",
            skyblue: "#87ceeb",
            slateblue: "#6a5acd",
            slategray: "#708090",
            slategrey: "#708090",
            snow: "#fffafa",
            springgreen: "#00ff7f",
            steelblue: "#4682b4",
            tan: "#d2b48c",
            teal: "#008080",
            thistle: "#d8bfd8",
            tomato: "#ff6347",
            turquoise: "#40e0d0",
            violet: "#ee82ee",
            wheat: "#f5deb3",
            white: "#fff",
            whitesmoke: "#f5f5f5",
            yellow: "#ff0",
            yellowgreen: "#9acd32"
        };
        return {
            customPalette: f,
            resetPalette: l,
            getColor: c,
            getHighlightColor: d,
            customHighlight: h,
            resetHighlight: p,
            getRadialGradient: v,
            getLinearGradient: m,
            getGradientColors: y,
            getStepColors: g,
            reverse: H,
            mix: B,
            lift: P,
            trim: _,
            random: j,
            toRGB: x,
            toRGBA: S,
            toHex: T,
            toHSL: O,
            toHSLA: A,
            toHSB: L,
            toHSBA: k,
            toHSV: C,
            toHSVA: N,
            toName: M,
            toColor: b,
            toArray: w,
            alpha: I,
            getData: F
        }
    }),
    /**
     * shape基类  
     * @typedef {Object} IBaseShapeStyle
     * @property {string} [brushType='fill']
     * @property {string} [color='#000000'] 填充颜色
     * @property {string} [strokeColor='#000000'] 描边颜色
     * @property {string} [lineCape='butt'] 线帽样式，可以是 butt, round, square
     * @property {number} [lineWidth=1] 描边宽度
     * @property {number} [opacity=1] 绘制透明度
     * @property {number} [shadowBlur=0] 阴影模糊度，大于0有效
     * @property {string} [shadowColor='#000000'] 阴影颜色
     * @property {number} [shadowOffsetX=0] 阴影横向偏移
     * @property {number} [shadowOffsetY=0] 阴影纵向偏移
     * @property {string} [text] 图形中的附加文本
     * @property {string} [textColor='#000000'] 文本颜色
     * @property {string} [textFont] 附加文本样式，eg:'bold 18px verdana'
     * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom
     * @property {string} [textAlign] 默认根据textPosition自动设置，附加文本水平对齐。
     *                                可以是start, end, left, right, center
     * @property {string} [textBaseline] 默认根据textPosition自动设置，附加文本垂直对齐。
     *                                可以是top, bottom, middle, alphabetic, hanging, ideographic
     * @typedef {Object} module:zrender/shape/Base~IBoundingRect
     * @property {number} x 左上角顶点x轴坐标 
     * @property {number} y 左上角顶点y轴坐标
     * @property {number} width 包围盒矩形宽度
     * @property {number} height 包围盒矩形高度
     */
    r("zrender/shape/Base", ["require", "../tool/matrix", "../tool/guid", "../tool/util", "../tool/log", "../mixin/Transformable", "../mixin/Eventful", "../tool/area", "../tool/area", "../tool/color", "../tool/area"],
    function(e) {
        function a(t, n, r, i, s, o, u) {
            s && (t.font = s),
            t.textAlign = o,
            t.textBaseline = u;
            var a = f(n, r, i, s, o, u);
            n = (n + "").split("\n");
            var l = e("../tool/area").getTextHeight("国", s);
            switch (u) {
            case "top":
                i = a.y;
                break;
            case "bottom":
                i = a.y + l;
                break;
            default:
                i = a.y + l / 2
            }
            for (var c = 0,
            h = n.length; c < h; c++) t.fillText(n[c], r, i),
            i += l
        }
        /**
         * 返回矩形区域，用于局部刷新和文字定位
         * @inner
         * @param {string} text
         * @param {number} x
         * @param {number} y
         * @param {string} textFont
         * @param {string} textAlign
         * @param {string} textBaseline
         */
        function f(t, n, r, i, s, o) {
            var u = e("../tool/area"),
            a = u.getTextWidth(t, i),
            f = u.getTextHeight("国", i);
            t = (t + "").split("\n");
            switch (s) {
            case "end":
            case "right":
                n -= a;
                break;
            case "center":
                n -= a / 2
            }
            switch (o) {
            case "top":
                break;
            case "bottom":
                r -= f * t.length;
                break;
            default:
                r -= f * t.length / 2
            }
            return {
                x: n,
                y: r,
                width: a,
                height: f * t.length
            }
        }
        var t = window.G_vmlCanvasManager,
        n = e("../tool/matrix"),
        r = e("../tool/guid"),
        i = e("../tool/util"),
        s = e("../tool/log"),
        o = e("../mixin/Transformable"),
        u = e("../mixin/Eventful"),
        //关于shape的配置项，可以是shape的自有属性，也可以是自定义的属性。
        l = function(e) {
            e = e || {},
            /**
             * Shape id, 全局唯一
             * @type {string}
             */
            this.id = e.id || r();
            for (var t in e) this[t] = e[t];
            /**
             * 基础绘制样式
             * @type {module:zrender/shape/Base~IBaseShapeStyle}
             */
            this.style = this.style || {},
            /**
             * 高亮样式
             * @type {module:zrender/shape/Base~IBaseShapeStyle}
             */
            this.highlightStyle = this.highlightStyle || null,
            /**
             * 父节点
             * @readonly
             * @type {module:zrender/Group}
             * @default null
             */
            this.parent = null,
            this.__dirty = !0,
            this.__clipShapes = [],
            o.call(this),
            u.call(this)
        };
        l.prototype.invisible = !1,//图形是否可见，为true时不绘制图形，但是仍能触发鼠标事件
        l.prototype.ignore = !1,//图形是否忽略，为true时忽略图形的绘制以及事件触发
        l.prototype.zlevel = 0,//z层level，决定绘画在哪层canvas中
        l.prototype.draggable = !1,//是否可拖拽默认false
        l.prototype.clickable = !1,//是否可点击默认false  0是false，1是true
        l.prototype.hoverable = !0,//是否可以hover 默认true
        l.prototype.z = 0,//z值，跟zlevel一样影响shape绘制的前后顺序，z值大的shape会覆盖在z值小的上面， 但是并不会创建新的canvas，所以优先级低于zlevel，而且频繁改动的开销比zlevel小很多。
        l.prototype.brush = function(e, t) {//绘制图形
            var n = this.beforeBrush(e, t);
            e.beginPath(),
            this.buildPath(e, n);
            switch (n.brushType) {
            case "both":
                e.fill();
            case "stroke":
                n.lineWidth > 0 && e.stroke();
                break;
            default:
                e.fill()
            }
            this.drawText(e, n, this.style),
            this.afterBrush(e)
        },
        //具体绘制操作前的一些公共操作
        l.prototype.beforeBrush = function(e, t) {
            var n = this.style;
            return this.brushTypeOnly && (n.brushType = this.brushTypeOnly),
            t && (n = this.getHighlightStyle(n, this.highlightStyle || {},
            this.brushTypeOnly)),
            this.brushTypeOnly == "stroke" && (n.strokeColor = n.strokeColor || n.color),
            e.save(),
            this.doClip(e),
            this.setContext(e, n),
            this.setTransform(e),
            n
        },
        //绘制后的处理
        l.prototype.afterBrush = function(e) {
            e.restore()
        };
        var c = [["color", "fillStyle"], ["strokeColor", "strokeStyle"], ["opacity", "globalAlpha"], ["lineCap", "lineCap"], ["lineJoin", "lineJoin"], ["miterLimit", "miterLimit"], ["lineWidth", "lineWidth"], ["shadowBlur", "shadowBlur"], ["shadowColor", "shadowColor"], ["shadowOffsetX", "shadowOffsetX"], ["shadowOffsetY", "shadowOffsetY"]];
        //设置 fillStyle, strokeStyle, shadow 等通用绘制样式
        l.prototype.setContext = function(e, t) {
            for (var n = 0,
            r = c.length; n < r; n++) {
                var i = c[n][0],
                s = t[i],
                o = c[n][1];
                typeof s != "undefined" && (e[o] = s)
            }
        };
        var h = n.create();
        return l.prototype.doClip = function(e) {
            if (this.__clipShapes && !t) for (var r = 0; r < this.__clipShapes.length; r++) {
                var i = this.__clipShapes[r];
                if (i.needTransform) {
                    var s = i.transform;
                    n.invert(h, s),
                    e.transform(s[0], s[1], s[2], s[3], s[4], s[5])
                }
                e.beginPath(),
                i.buildPath(e, i.style),
                e.clip();
                if (i.needTransform) {
                    var s = h;
                    e.transform(s[0], s[1], s[2], s[3], s[4], s[5])
                }
            }
        },
        //根据默认样式扩展高亮样式
        l.prototype.getHighlightStyle = function(t, n, r) {
            var i = {};
            for (var s in t) i[s] = t[s];
            var o = e("../tool/color"),
            u = o.getHighlightColor();
            t.brushType != "stroke" ? (i.strokeColor = u, i.lineWidth = (t.lineWidth || 1) + this.getHighlightZoom(), i.brushType = "both") : r != "stroke" ? (i.strokeColor = u, i.lineWidth = (t.lineWidth || 1) + this.getHighlightZoom()) : i.strokeColor = n.strokeColor || o.mix(t.strokeColor, o.toRGB(u));
            for (var s in n) typeof n[s] != "undefined" && (i[s] = n[s]);
            return i
        },
        l.prototype.getHighlightZoom = function() {
            return this.type != "text" ? 6 : 2
        },
        //移动位置
        l.prototype.drift = function(e, t) {
            this.position[0] += e,
            this.position[1] += t
        },
        //构建绘制的Path
        l.prototype.buildPath = function(e, t) {
            s("buildPath not implemented in " + this.type)
        },
        //计算返回包围盒矩形
        l.prototype.getRect = function(e) {
            s("getRect not implemented in " + this.type)
        },
        //判断鼠标位置是否在图形内
        l.prototype.isCover = function(t, n) {
            var r = this.transformCoordToLocal(t, n);
            return t = r[0],
            n = r[1],
            this.isCoverRect(t, n) ? e("../tool/area").isInside(this, this.style, t, n) : !1
        },
        l.prototype.isCoverRect = function(e, t) {
            var n = this.style.__rect;
            return n || (n = this.style.__rect = this.getRect(this.style)),
            e >= n.x && e <= n.x + n.width && t >= n.y && t <= n.y + n.height
        },
        //绘制附加文本yyh
        l.prototype.drawText = function(e, t, n) {
            if (typeof t.text == "undefined" || t.text === !1) return;
            var r = t.textColor || t.color || t.strokeColor;
            e.fillStyle = r;
            var i = 10,
            s, o, u, f, l = t.textPosition || this.textPosition || "top";
            switch (l) {
            case "inside":
            case "top":
            case "bottom":
            case "left":
            case "right":
                if (this.getRect) {
                    var c = (n || t).__rect || this.getRect(n || t);
                    switch (l) {
                    case "inside":
                        u = c.x + c.width / 2,
                        f = c.y + c.height / 2,
                        s = "center",
                        o = "middle",
                        t.brushType != "stroke" && r == t.color && (e.fillStyle = "#fff");
                        break;
                    case "left":
                        u = c.x - i,
                        f = c.y + c.height / 2,
                        s = "end",
                        o = "middle";
                        break;
                    case "right":
                        u = c.x + c.width + i,
                        f = c.y + c.height / 2,
                        s = "start",
                        o = "middle";
                        break;
                    case "top":
                        u = c.x + c.width / 2,
                        f = c.y - i,
                        s = "center",
                        o = "bottom";
                        break;
                    case "bottom":
                        u = c.x + c.width / 2,
                        f = c.y + c.height + i,
                        s = "center",
                        o = "top"
                    }
                }
                break;
            case "start":
            case "end":
                var h = t.pointList || [[t.xStart || 0, t.yStart || 0], [t.xEnd || 0, t.yEnd || 0]],
                p = h.length;
                if (p < 2) return;
                var d, v, m, g;
                switch (l) {
                case "start":
                    d = h[1][0],
                    v = h[0][0],
                    m = h[1][1],
                    g = h[0][1];
                    break;
                case "end":
                    d = h[p - 2][0],
                    v = h[p - 1][0],
                    m = h[p - 2][1],
                    g = h[p - 1][1]
                }
                u = v,
                f = g;
                var y = Math.atan((m - g) / (v - d)) / Math.PI * 180;
                v - d < 0 ? y += 180 : m - g < 0 && (y += 360),
                i = 5,
                y >= 30 && y <= 150 ? (s = "center", o = "bottom", f -= i) : y > 150 && y < 210 ? (s = "right", o = "middle", u -= i) : y >= 210 && y <= 330 ? (s = "center", o = "top", f += i) : (s = "left", o = "middle", u += i);
                break;
            case "specific":
                u = t.textX || 0,
                f = t.textY || 0,
                s = "start",
                o = "middle"
            }
            u != null && f != null && a(e, t.text, u, f, t.textFont, t.textAlign || s, t.textBaseline || o)
        },
        l.prototype.modSelf = function() {
            this.__dirty = !0,
            this.style && (this.style.__rect = null),
            this.highlightStyle && (this.highlightStyle.__rect = null)
        },
        //图形是否会触发事件
        l.prototype.isSilent = function() {
            return ! (this.hoverable || this.draggable || this.clickable || this.onmousemove || this.onmouseover || this.onmouseout || this.onmousedown || this.onmouseup || this.onclick || this.ondragenter || this.ondragover || this.ondragleave || this.ondrop)
        },
        i.merge(l.prototype, o.prototype, !0),
        i.merge(l.prototype, u.prototype, !0),
        l
    }),
    r("zrender/shape/Text", ["require", "../tool/area", "./Base", "../tool/util"], function(e) {
        var t = e("../tool/area"),
        n = e("./Base"),
        r = function(e) {
            n.call(this, e)
        };
        return r.prototype = {
            type: "text",
            brush: function(e, n) {
                var r = this.style;
                n && (r = this.getHighlightStyle(r, this.highlightStyle || {}));
                if (typeof r.text == "undefined" || r.text === !1) return;
                e.save(),
                this.doClip(e),
                this.setContext(e, r),
                this.setTransform(e),
                r.textFont && (e.font = r.textFont),
                e.textAlign = r.textAlign || "start",
                e.textBaseline = r.textBaseline || "middle";
                var i = (r.text + "").split("\n"),
                s = t.getTextHeight("国", r.textFont),
                o = this.getRect(r),
                u = r.x,
                a;
                r.textBaseline == "top" ? a = o.y: r.textBaseline == "bottom" ? a = o.y + s: a = o.y + s / 2;
                for (var f = 0,
                l = i.length; f < l; f++) {
                    if (r.maxWidth) switch (r.brushType) {
                    case "fill":
                        e.fillText(i[f], u, a, r.maxWidth);
                        break;
                    case "stroke":
                        e.strokeText(i[f], u, a, r.maxWidth);
                        break;
                    case "both":
                        e.fillText(i[f], u, a, r.maxWidth),
                        e.strokeText(i[f], u, a, r.maxWidth);
                        break;
                    default:
                        e.fillText(i[f], u, a, r.maxWidth)
                    } else switch (r.brushType) {
                    case "fill":
                        e.fillText(i[f], u, a);
                        break;
                    case "stroke":
                        e.strokeText(i[f], u, a);
                        break;
                    case "both":
                        e.fillText(i[f], u, a),
                        e.strokeText(i[f], u, a);
                        break;
                    default:
                        e.fillText(i[f], u, a)
                    }
                    a += s
                }
                e.restore();
                return
            },
            //返回文字包围盒矩形
            getRect: function(e) {
                if (e.__rect) return e.__rect;
                var n = t.getTextWidth(e.text, e.textFont),
                r = t.getTextHeight(e.text, e.textFont),
                i = e.x;
                e.textAlign == "end" || e.textAlign == "right" ? i -= n: e.textAlign == "center" && (i -= n / 2);
                var s;
                return e.textBaseline == "top" ? s = e.y: e.textBaseline == "bottom" ? s = e.y - r: s = e.y - r / 2,
                e.__rect = {
                    x: i,
                    y: s,
                    width: n,
                    height: r
                },
                e.__rect
            }
        },
        e("../tool/util").inherits(r, n),
        r
    }),
    //绘制矩形
    r("zrender/shape/Rectangle", ["require", "./Base", "../tool/util"], function(e) {
        var t = e("./Base"),
        n = function(e) {
            t.call(this, e)
        };
        return n.prototype = {
            type: "rectangle",
            _buildRadiusPath: function(e, t) {
                var n = t.x,
                r = t.y,
                i = t.width,
                s = t.height,
                o = t.radius,
                u, a, f, l;
                typeof o == "number" ? u = a = f = l = o: o instanceof Array ? o.length === 1 ? u = a = f = l = o[0] : o.length === 2 ? (u = f = o[0], a = l = o[1]) : o.length === 3 ? (u = o[0], a = l = o[1], f = o[2]) : (u = o[0], a = o[1], f = o[2], l = o[3]) : u = a = f = l = 0;
                var c;
                u + a > i && (c = u + a, u *= i / c, a *= i / c),
                f + l > i && (c = f + l, f *= i / c, l *= i / c),
                a + f > s && (c = a + f, a *= s / c, f *= s / c),
                u + l > s && (c = u + l, u *= s / c, l *= s / c),
                e.moveTo(n + u, r),
                e.lineTo(n + i - a, r),
                a !== 0 && e.quadraticCurveTo(n + i, r, n + i, r + a),
                e.lineTo(n + i, r + s - f),
                f !== 0 && e.quadraticCurveTo(n + i, r + s, n + i - f, r + s),
                e.lineTo(n + l, r + s),
                l !== 0 && e.quadraticCurveTo(n, r + s, n, r + s - l),
                e.lineTo(n, r + u),
                u !== 0 && e.quadraticCurveTo(n, r, n + u, r)
            },
            //创建矩形路径
            buildPath: function(e, t) {
                t.radius ? this._buildRadiusPath(e, t) : (e.moveTo(t.x, t.y), e.lineTo(t.x + t.width, t.y), e.lineTo(t.x + t.width, t.y + t.height), e.lineTo(t.x, t.y + t.height), e.lineTo(t.x, t.y)),
                e.closePath();
                return
            },
            //计算返回矩形包围盒矩阵
            getRect: function(e) {
                if (e.__rect) return e.__rect;
                var t;
                return e.brushType == "stroke" || e.brushType == "fill" ? t = e.lineWidth || 1 : t = 0,
                e.__rect = {
                    x: Math.round(e.x - t / 2),
                    y: Math.round(e.y - t / 2),
                    width: e.width + t,
                    height: e.height + t
                },
                e.__rect
            }
        },
        e("../tool/util").inherits(n, t),
        n
    }),
    /*yyh*/
    /**
     * zrender: loading特效类
     *
     * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
     *         errorrik (errorrik@gmail.com)
     */
    r("zrender/loadingEffect/Base", ["require", "../tool/util", "../shape/Text", "../shape/Rectangle"], function(e) {
        function o(e) {
            this.setOptions(e)
        }
        var t = e("../tool/util"),
        n = e("../shape/Text"),
        r = e("../shape/Rectangle"),
        i = "Loading...",
        s = "normal 16px Arial";
        return o.prototype.createTextShape = function(e) {
            return new n({
                highlightStyle: t.merge({
                    x: this.canvasWidth / 2,
                    y: this.canvasHeight / 2,
                    text: i,
                    textAlign: "center",
                    textBaseline: "middle",
                    textFont: s,
                    color: "#333",
                    brushType: "fill"
                },
                e, !0)
            })
        },
        o.prototype.createBackgroundShape = function(e) {
            return new r({
                highlightStyle: {
                    x: 0,
                    y: 0,
                    width: this.canvasWidth,
                    height: this.canvasHeight,
                    brushType: "fill",
                    color: e
                }
            })
        },
        o.prototype.start = function(e) {
            function t(t) {
                e.storage.addHover(t)
            }
            function n() {
                e.refreshHover()
            }
            this.canvasWidth = e._width,
            this.canvasHeight = e._height,
            this.loadingTimer = this._start(t, n)
        },
        o.prototype._start = function() {
            return setInterval(function() {},
            1e4)
        },
        o.prototype.stop = function() {
            clearInterval(this.loadingTimer)
        },
        o.prototype.setOptions = function(e) {
            this.options = e || {}
        },
        o.prototype.adjust = function(e, t) {
            return e <= t[0] ? e = t[0] : e >= t[1] && (e = t[1]),
            e
        },
        o.prototype.getLocation = function(e, t, n) {
            var r = e.x != null ? e.x: "center";
            switch (r) {
            case "center":
                r = Math.floor((this.canvasWidth - t) / 2);
                break;
            case "left":
                r = 0;
                break;
            case "right":
                r = this.canvasWidth - t
            }
            var i = e.y != null ? e.y: "center";
            switch (i) {
            case "center":
                i = Math.floor((this.canvasHeight - n) / 2);
                break;
            case "top":
                i = 0;
                break;
            case "bottom":
                i = this.canvasHeight - n
            }
            return {
                x: r,
                y: i,
                width: t,
                height: n
            }
        },
        o
    }),
    
    r("zrender/Layer", ["require", "./mixin/Transformable", "./tool/util", "./config"], function(e) {
        function s() {
            return ! 1
        }
        function o(e, t, n) {
            var r = document.createElement(t),
            s = n.getWidth(),
            o = n.getHeight();
            return r.style.position = "absolute",
            r.style.left = 0,
            r.style.top = 0,
            r.style.width = s + "px",
            r.style.height = o + "px",
            r.width = s * i.devicePixelRatio,
            r.height = o * i.devicePixelRatio,
            r.setAttribute("data-zr-dom-id", e),
            r
        }
        var t = e("./mixin/Transformable"),
        n = e("./tool/util"),
        r = window.G_vmlCanvasManager,
        i = e("./config"),
        u = function(e, n) {
            this.id = e,
            this.dom = o(e, "canvas", n),
            this.dom.onselectstart = s,
            this.dom.style["-webkit-user-select"] = "none",
            this.dom.style["user-select"] = "none",
            this.dom.style["-webkit-touch-callout"] = "none",
            this.dom.style["-webkit-tap-highlight-color"] = "rgba(0,0,0,0)",
            r && r.initElement(this.dom),
            this.domBack = null,
            this.ctxBack = null,
            this.painter = n,
            this.unusedCount = 0,
            this.config = null,
            this.dirty = !0,
            this.elCount = 0,
            this.clearColor = 0,
            this.motionBlur = !1,
            this.lastFrameAlpha = .7,
            this.zoomable = !1,
            this.panable = !1,
            this.maxZoom = Infinity,
            this.minZoom = 0,
            t.call(this)
        };
        return u.prototype.initContext = function() {
            this.ctx = this.dom.getContext("2d");
            var e = i.devicePixelRatio;
            e != 1 && this.ctx.scale(e, e)
        },
        u.prototype.createBackBuffer = function() {
            if (r) return;
            this.domBack = o("back-" + this.id, "canvas", this.painter),
            this.ctxBack = this.domBack.getContext("2d");
            var e = i.devicePixelRatio;
            e != 1 && this.ctxBack.scale(e, e)
        },
        u.prototype.resize = function(e, t) {
            var n = i.devicePixelRatio;
            this.dom.style.width = e + "px",
            this.dom.style.height = t + "px",
            this.dom.setAttribute("width", e * n),
            this.dom.setAttribute("height", t * n),
            n != 1 && this.ctx.scale(n, n),
            this.domBack && (this.domBack.setAttribute("width", e * n), this.domBack.setAttribute("height", t * n), n != 1 && this.ctxBack.scale(n, n))
        },
        //清空该层画布
        u.prototype.clear = function() {
            var e = this.dom,
            t = this.ctx,
            n = e.width,
            s = e.height,
            o = this.clearColor && !r,
            u = this.motionBlur && !r,
            a = this.lastFrameAlpha,
            f = i.devicePixelRatio;
            u && (this.domBack || this.createBackBuffer(), this.ctxBack.globalCompositeOperation = "copy", this.ctxBack.drawImage(e, 0, 0, n / f, s / f)),
            t.clearRect(0, 0, n / f, s / f),
            o && (t.save(), t.fillStyle = this.clearColor, t.fillRect(0, 0, n / f, s / f), t.restore());
            if (u) {
                var l = this.domBack;
                t.save(),
                t.globalAlpha = a,
                t.drawImage(l, 0, 0, n / f, s / f),
                t.restore()
            }
        },
        n.merge(u.prototype, t.prototype),
        u
    }),
    //图片绘制
    r("zrender/shape/Image", ["require", "./Base", "../tool/util"], function(e) {
        var t = e("./Base"),
        n = function(e) {
            t.call(this, e)
        };
        return n.prototype = {
            type: "image",
            brush: function(e, t, n) {
                var r = this.style || {};
                // 根据style扩展默认高亮样式
                if(t){
                	r = this.getHighlightStyle(
                			r, this.highlightStyle || {}
                        );
                }
                var i = r.image,
                s = this;
                this._imageCache || (this._imageCache = {});
                if (typeof i == "string") {
                    var o = i;
                    this._imageCache[o] ? i = this._imageCache[o] : (i = new Image, i.onload = function() {
                        i.onload = null,
                        s.modSelf(),
                        n()
                    },
                    i.src = o, this._imageCache[o] = i)
                }
                if (i) {
                	// 图片已经加载完成
                    if (i.nodeName.toUpperCase() == "IMG") if (window.ActiveXObject) {
                        if (i.readyState != "complete") return
                    } else if (!i.complete) return;
                    var u = r.width || i.width,
                    a = r.height || i.height,
                    f = r.x,
                    l = r.y;
                    // 图片加载失败
                    if (!i.width || !i.height) return;
                    e.save(),
                    this.doClip(e),
                    this.setContext(e, r),
                    // 设置transform
                    this.setTransform(e);
                    if (r.sWidth && r.sHeight) {
                        var c = r.sx || 0,
                        h = r.sy || 0;
                        e.drawImage(i, c, h, r.sWidth, r.sHeight, f, l, u, a)
                    } else if (r.sx && r.sy) {
                        var c = r.sx,
                        h = r.sy,
                        p = u - c,
                        d = a - h;
                        e.drawImage(i, c, h, p, d, f, l, u, a)
                    } else e.drawImage(i, f, l, u, a);
                    // 如果没设置宽和高的话自动根据图片宽高设置
                    if (!r.width) {
                    	r.width = u;
                    }
                    if (!r.height) {
                    	r.height = a;
                    }
                    if (!this.style.width) {
                        this.style.width = u;
                    }
                    if (!this.style.height) {
                        this.style.height = a;
                    }
                    this.drawText(e, r, this.style),
                    e.restore()
                }
            },
            getRect: function(e) {
                return {
                    x: e.x,
                    y: e.y,
                    width: e.width,
                    height: e.height
                }
            },
            clearCache: function() {
                this._imageCache = {}
            }
        },
        e("../tool/util").inherits(n, t),
        n
    }),
    /**
     * Painter绘图模块
     * @module zrender/Painter
     * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
     *         errorrik (errorrik@gmail.com)
     *         pissang (https://www.github.com/pissang)
     */
    r("zrender/Painter", ["require", "./config", "./tool/util", "./tool/log", "./loadingEffect/Base", "./Layer", "./shape/Image"],
    function(e) {
    	// 返回false的方法，用于避免页面被选中
        function o() {
            return ! 1
        }
        // 什么都不干的空方法
        function u() {}
        function a(e) {
            return e ? e.isBuildin ? !0 : typeof e.resize != "function" || typeof e.refresh != "function" ? !1 : !0 : !1
        }
        var t = e("./config"),
        n = e("./tool/util"),
        r = e("./tool/log"),
        i = e("./loadingEffect/Base"),
        s = e("./Layer"),
        f = function(e, t) {
            this.root = e,//root绘图容器
            e.style["-webkit-tap-highlight-color"] = "transparent",
            e.style["-webkit-user-select"] = "none",
            e.style["user-select"] = "none",
            e.style["-webkit-touch-callout"] = "none",
            this.storage = t,
            e.innerHTML = "",
            this._width = this._getWidth(),
            this._height = this._getHeight();
            var n = document.createElement("div");
            this._domRoot = n,
            n.style.position = "relative",
            n.style.overflow = "hidden",
            n.style.width = this._width + "px",
            n.style.height = this._height + "px",
            e.appendChild(n),
            this._layers = {},
            this._zlevelList = [],
            this._layerConfig = {},
            this._loadingEffect = new i({}),
            this.shapeToImage = this._createShapeToImageProcessor(),
            // 创建各层canvas
            // 背景
            this._bgDom = document.createElement("div"),
            this._bgDom.style.cssText = ["position:absolute;left:0px;top:0px;width:", this._width, "px;height:", this._height + "px;", "-webkit-user-select:none;user-select;none;", "-webkit-touch-callout:none;"].join(""),
            this._bgDom.setAttribute("data-zr-dom-id", "bg"),
            n.appendChild(this._bgDom),
            this._bgDom.onselectstart = o;
            var r = new s("_zrender_hover_", this);
            // 高亮
            this._layers.hover = r,
            n.appendChild(r.dom),
            r.initContext(),
            r.dom.onselectstart = o,
            r.dom.style["-webkit-user-select"] = "none",
            r.dom.style["user-select"] = "none",
            r.dom.style["-webkit-touch-callout"] = "none",
            this.refreshNextFrame = null
        };
        //首次绘图，创建各种dom和context
        return f.prototype.render = function(e) {
            return this.isLoading() && this.hideLoading(),
            this.refresh(e, !0),
            this
        },
        //刷新
        /* e 刷新结束后的回调函数
         * t 强制绘制所有shape
         * */
        f.prototype.refresh = function(e, t) {
            var n = this.storage.getShapeList(!0);
            this._paintList(n, t);
            for (var r = 0; r < this._zlevelList.length; r++) {
                var i = this._zlevelList[r],
                s = this._layers[i]; ! s.isBuildin && s.refresh && s.refresh()
            }
            return typeof e == "function" && e(),
            this
        },
        f.prototype._preProcessLayer = function(e) {
            e.unusedCount++,
            e.updateTransform()
        },
        f.prototype._postProcessLayer = function(e) {
            e.dirty = !1,
            e.unusedCount == 1 && e.clear()
        },
        f.prototype._paintList = function(e, n) {
            typeof n == "undefined" && (n = !1),
            this._updateLayerStatus(e);
            var i, s, o;
            this.eachBuildinLayer(this._preProcessLayer);
            for (var u = 0,
            a = e.length; u < a; u++) {
                var f = e[u];
                s !== f.zlevel && (i && (i.needTransform && o.restore(), o.flush && o.flush()), s = f.zlevel, i = this.getLayer(s), i.isBuildin || r("ZLevel " + s + " has been used by unkown layer " + i.id), o = i.ctx, i.unusedCount = 0, (i.dirty || n) && i.clear(), i.needTransform && (o.save(), i.setTransform(o)));
                if ((i.dirty || n) && !f.invisible) if (!f.onbrush || f.onbrush && !f.onbrush(o, !1)) if (t.catchBrushException) try {
                    f.brush(o, !1, this.refreshNextFrame)
                } catch(l) {
                    r(l, "brush error of " + f.type, f)
                } else f.brush(o, !1, this.refreshNextFrame);
                f.__dirty = !1
            }
            i && (i.needTransform && o.restore(), o.flush && o.flush()),
            this.eachBuildinLayer(this._postProcessLayer)
        },
        //获取 zlevel 所在层，如果不存在则会创建一个新的层
        f.prototype.getLayer = function(e) {
            var t = this._layers[e];
            return t || (t = new s(e, this), t.isBuildin = !0, this._layerConfig[e] && n.merge(t, this._layerConfig[e], !0), t.updateTransform(), this.insertLayer(e, t), t.initContext()),
            t
        },
        f.prototype.insertLayer = function(e, t) {
            if (this._layers[e]) {
                r("ZLevel " + e + " has been used already");
                return
            }
            if (!a(t)) {
                r("Layer of zlevel " + e + " is not valid");
                return
            }
            var n = this._zlevelList.length,
            i = null,
            s = -1;
            if (n > 0 && e > this._zlevelList[0]) {
                for (s = 0; s < n - 1; s++) if (this._zlevelList[s] < e && this._zlevelList[s + 1] > e) break;
                i = this._layers[this._zlevelList[s]]
            }
            this._zlevelList.splice(s + 1, 0, e);
            var o = i ? i.dom: this._bgDom;
            o.nextSibling ? o.parentNode.insertBefore(t.dom, o.nextSibling) : o.parentNode.appendChild(t.dom),
            this._layers[e] = t
        },
        f.prototype.eachLayer = function(e, t) {
            for (var n = 0; n < this._zlevelList.length; n++) {
                var r = this._zlevelList[n];
                e.call(t, this._layers[r], r)
            }
        },
        f.prototype.eachBuildinLayer = function(e, t) {
            for (var n = 0; n < this._zlevelList.length; n++) {
                var r = this._zlevelList[n],
                i = this._layers[r];
                i.isBuildin && e.call(t, i, r)
            }
        },
        f.prototype.eachOtherLayer = function(e, t) {
            for (var n = 0; n < this._zlevelList.length; n++) {
                var r = this._zlevelList[n],
                i = this._layers[r];
                i.isBuildin || e.call(t, i, r)
            }
        },
        //获取所有已创建的层
        f.prototype.getLayers = function() {
            return this._layers
        },
        f.prototype._updateLayerStatus = function(e) {
            var t = this._layers,
            n = {};
            this.eachBuildinLayer(function(e, t) {
                n[t] = e.elCount,
                e.elCount = 0
            });
            for (var r = 0,
            i = e.length; r < i; r++) {
                var s = e[r],
                o = s.zlevel,
                u = t[o];
                if (u) {
                    u.elCount++;
                    if (u.dirty) continue;
                    u.dirty = s.__dirty
                }
            }
            this.eachBuildinLayer(function(e, t) {
                n[t] !== e.elCount && (e.dirty = !0)
            })
        },
        //指定的图形列表
        f.prototype.refreshShapes = function(e, t) {
            for (var n = 0,
            r = e.length; n < r; n++) {
                var i = e[n];
                i.modSelf()
            }
            return this.refresh(t),
            this
        },
        //设置loading特效
        f.prototype.setLoadingEffect = function(e) {
            return this._loadingEffect = e,
            this
        },
        //清除hover层外所有内容
        f.prototype.clear = function() {
            return this.eachBuildinLayer(this._clearLayer),
            this
        },
        //清除单独的一个层
        f.prototype._clearLayer = function(e) {
            e.clear()
        },
        //修改指定zlevel的绘制参数
        f.prototype.modLayer = function(e, t) {
            if (t) {
                this._layerConfig[e] ? n.merge(this._layerConfig[e], t, !0) : this._layerConfig[e] = t;
                var r = this._layers[e];
                r && n.merge(r, this._layerConfig[e], !0)
            }
        },
        //删除指定层
        f.prototype.delLayer = function(e) {
            var t = this._layers[e];
            if (!t) return;
            this.modLayer(e, {
                position: t.position,
                rotation: t.rotation,
                scale: t.scale
            }),
            t.dom.parentNode.removeChild(t.dom),
            delete this._layers[e],
            this._zlevelList.splice(n.indexOf(this._zlevelList, e), 1)
        },
        //刷新hover层
        f.prototype.refreshHover = function() {
            this.clearHover();
            var e = this.storage.getHoverShapes(!0);
            for (var t = 0,
            n = e.length; t < n; t++) this._brushHover(e[t]);
            var r = this._layers.hover.ctx;
            return r.flush && r.flush(),
            this.storage.delHover(),
            this
        },
        //清除hover层所有内容
        f.prototype.clearHover = function() {
            var e = this._layers.hover;
            return e && e.clear(),
            this
        },
        //显示loading
        f.prototype.showLoading = function(e) {
            return this._loadingEffect && this._loadingEffect.stop(),
            e && this.setLoadingEffect(e),
            this._loadingEffect.start(this),
            this.loading = !0,
            this
        },
        //loading结束
        f.prototype.hideLoading = function() {
            return this._loadingEffect.stop(),
            this.clearHover(),
            this.loading = !1,
            this
        },
        //loading结束判断
        f.prototype.isLoading = function() {
            return this.loading
        },
        //区域大小变化后重绘
        f.prototype.resize = function() {
            var e = this._domRoot;
            e.style.display = "none";
            var t = this._getWidth(),
            n = this._getHeight();
            e.style.display = "";
            if (this._width != t || n != this._height) {
                this._width = t,
                this._height = n,
                e.style.width = t + "px",
                e.style.height = n + "px";
                for (var r in this._layers) this._layers[r].resize(t, n);
                this.refresh(null, !0)
            }
            return this
        },
        //清除单独的一个层
        f.prototype.clearLayer = function(e) {
            var t = this._layers[e];
            t && t.clear()
        },
        //释放
        f.prototype.dispose = function() {
            this.isLoading() && this.hideLoading(),
            this.root.innerHTML = "",
            this.root = this.storage = this._domRoot = this._layers = null
        },
        f.prototype.getDomHover = function() {
            return this._layers.hover.dom
        },
        //图像导出
        f.prototype.toDataURL = function(e, n, i) {
            if (window.G_vmlCanvasManager) return null;
            var o = new s("image", this);
            this._bgDom.appendChild(o.dom),
            o.initContext();
            var u = o.ctx;
            o.clearColor = n || "#fff",
            o.clear();
            var a = this;
            this.storage.iterShape(function(e) {
                if (!e.invisible) if (!e.onbrush || e.onbrush && !e.onbrush(u, !1)) if (t.catchBrushException) try {
                    e.brush(u, !1, a.refreshNextFrame)
                } catch(n) {
                    r(n, "brush error of " + e.type, e)
                } else e.brush(u, !1, a.refreshNextFrame)
            },
            {
                normal: "up",
                update: !0
            });
            var f = o.dom.toDataURL(e, i);
            return u = null,
            this._bgDom.removeChild(o.dom),
            f
        },
        f.prototype.getWidth = function() {
            return this._width
        },
        f.prototype.getHeight = function() {
            return this._height
        },
        f.prototype._getWidth = function() {
            var e = this.root,
            t = e.currentStyle || document.defaultView.getComputedStyle(e);
            return ((e.clientWidth || parseInt(t.width, 10)) - parseInt(t.paddingLeft, 10) - parseInt(t.paddingRight, 10)).toFixed(0) - 0
        },
        f.prototype._getHeight = function() {
            var e = this.root,
            t = e.currentStyle || document.defaultView.getComputedStyle(e);
            return ((e.clientHeight || parseInt(t.height, 10)) - parseInt(t.paddingTop, 10) - parseInt(t.paddingBottom, 10)).toFixed(0) - 0
        },
        /*yyh hover事件*/
        f.prototype._brushHover = function(e) {
            var n = this._layers.hover.ctx;
            if (!e.onbrush || e.onbrush && !e.onbrush(n, !0)) {
                var i = this.getLayer(e.zlevel);
                i.needTransform && (n.save(), i.setTransform(n));
                if (t.catchBrushException) try {
                    e.brush(n, !0, this.refreshNextFrame)
                } catch(s) {
                    r(s, "hoverBrush error of " + e.type, e)
                } else e.brush(n, !0, this.refreshNextFrame);
                i.needTransform && n.restore()
            }
        },
        f.prototype._shapeToImage = function(t, n, r, i, s) {
            var o = document.createElement("canvas"),
            u = o.getContext("2d");
            o.style.width = r + "px",
            o.style.height = i + "px",
            o.setAttribute("width", r * s),
            o.setAttribute("height", i * s),
            u.clearRect(0, 0, r * s, i * s);
            var a = {
                position: n.position,
                rotation: n.rotation,
                scale: n.scale
            };
            n.position = [0, 0, 0],
            n.rotation = 0,
            n.scale = [1, 1],
            n && n.brush(u, !1);
            var f = e("./shape/Image"),
            l = new f({
                id: t,
                style: {
                    x: 0,
                    y: 0,
                    image: o
                }
            });
            return a.position != null && (l.position = n.position = a.position),
            a.rotation != null && (l.rotation = n.rotation = a.rotation),
            a.scale != null && (l.scale = n.scale = a.scale),
            l
        },
        f.prototype._createShapeToImageProcessor = function() {
            if (window.G_vmlCanvasManager) return u;
            var e = this;
            return function(n, r, i, s) {
                return e._shapeToImage(n, r, i, s, t.devicePixelRatio)
            }
        },
        f
    }),
    //Group是一个容器，可以插入子节点，Group的变换也会被应用到子节点上
    r("zrender/Group", ["require", "./tool/guid", "./tool/util", "./mixin/Transformable", "./mixin/Eventful"],
    function(e) {
        var t = e("./tool/guid"),
        n = e("./tool/util"),
        r = e("./mixin/Transformable"),
        i = e("./mixin/Eventful"),
        s = function(e) {
            e = e || {},
            this.id = e.id || t();
            for (var n in e) this[n] = e[n];
            this.type = "group",
            this.clipShape = null,
            this._children = [],
            this._storage = null,
            this.__dirty = !0,
            r.call(this),
            i.call(this)
        };
        return s.prototype.ignore = !1,
        s.prototype.children = function() {
            return this._children.slice()
        },
        s.prototype.childAt = function(e) {
            return this._children[e]
        },
        s.prototype.addChild = function(e) {
            if (e == this) return;
            if (e.parent == this) return;
            e.parent && e.parent.removeChild(e),
            this._children.push(e),
            e.parent = this,
            this._storage && this._storage !== e._storage && (this._storage.addToMap(e), e instanceof s && e.addChildrenToStorage(this._storage))
        },
        s.prototype.removeChild = function(e) {
            var t = n.indexOf(this._children, e);
            this._children.splice(t, 1),
            e.parent = null,
            this._storage && (this._storage.delFromMap(e.id), e instanceof s && e.delChildrenFromStorage(this._storage))
        },
        s.prototype.clearChildren = function() {
            for (var e = 0; e < this._children.length; e++) {
                var t = this._children[e];
                this._storage && (this._storage.delFromMap(t.id), t instanceof s && t.delChildrenFromStorage(this._storage))
            }
            this._children.length = 0
        },
        s.prototype.eachChild = function(e, t) {
            var n = !!t;
            for (var r = 0; r < this._children.length; r++) {
                var i = this._children[r];
                n ? e.call(t, i) : e(i)
            }
        },
        s.prototype.traverse = function(e, t) {
            var n = !!t;
            for (var r = 0; r < this._children.length; r++) {
                var i = this._children[r];
                n ? e.call(t, i) : e(i),
                i.type === "group" && i.traverse(e, t)
            }
        },
        s.prototype.addChildrenToStorage = function(e) {
            for (var t = 0; t < this._children.length; t++) {
                var n = this._children[t];
                e.addToMap(n),
                n instanceof s && n.addChildrenToStorage(e)
            }
        },
        s.prototype.delChildrenFromStorage = function(e) {
            for (var t = 0; t < this._children.length; t++) {
                var n = this._children[t];
                e.delFromMap(n.id),
                n instanceof s && n.delChildrenFromStorage(e)
            }
        },
        s.prototype.modSelf = function() {
            this.__dirty = !0
        },
        n.merge(s.prototype, r.prototype, !0),
        n.merge(s.prototype, i.prototype, !0),
        s
    }),
    //Storage内容仓库模块
    r("zrender/Storage", ["require", "./tool/util", "./Group"],
    function(e) {
        function i(e, t) {
            return e.zlevel == t.zlevel ? e.z == t.z ? e.__renderidx - t.__renderidx: e.z - t.z: e.zlevel - t.zlevel
        }
        var t = e("./tool/util"),
        n = e("./Group"),
        r = {
            hover: !1,
            normal: "down",
            update: !1
        },
        s = function() {
            this._elements = {},
            this._hoverElements = [],
            this._roots = [],
            this._shapeList = [],
            this._shapeListOffset = 0
        };
        return s.prototype.iterShape = function(e, t) {
            t || (t = r);
            if (t.hover) for (var n = 0,
            i = this._hoverElements.length; n < i; n++) {
                var s = this._hoverElements[n];
                s.updateTransform();
                if (e(s)) return this
            }
            t.update && this.updateShapeList();
            switch (t.normal) {
            case "down":
                var i = this._shapeList.length;
                while (i--) if (e(this._shapeList[i])) return this;
                break;
            default:
                for (var n = 0,
                i = this._shapeList.length; n < i; n++) if (e(this._shapeList[n])) return this
            }
            return this
        },
        s.prototype.getHoverShapes = function(e) {
            var t = [];
            for (var n = 0,
            r = this._hoverElements.length; n < r; n++) {
                t.push(this._hoverElements[n]);
                var s = this._hoverElements[n].hoverConnect;
                if (s) {
                    var o;
                    s = s instanceof Array ? s: [s];
                    for (var u = 0,
                    a = s.length; u < a; u++) o = s[u].id ? s[u] : this.get(s[u]),
                    o && t.push(o)
                }
            }
            t.sort(i);
            if (e) for (var n = 0,
            r = t.length; n < r; n++) t[n].updateTransform();
            return t
        },
        s.prototype.getShapeList = function(e) {
            return e && this.updateShapeList(),
            this._shapeList
        },
        s.prototype.updateShapeList = function() {
            this._shapeListOffset = 0;
            for (var e = 0,
            t = this._roots.length; e < t; e++) {
                var n = this._roots[e];
                this._updateAndAddShape(n)
            }
            this._shapeList.length = this._shapeListOffset;
            for (var e = 0,
            t = this._shapeList.length; e < t; e++) this._shapeList[e].__renderidx = e;
            this._shapeList.sort(i)
        },
        s.prototype._updateAndAddShape = function(e, t) {
            if (e.ignore) return;
            e.updateTransform();
            if (e.type == "group") {
                e.clipShape && (e.clipShape.parent = e, e.clipShape.updateTransform(), t ? (t = t.slice(), t.push(e.clipShape)) : t = [e.clipShape]);
                for (var n = 0; n < e._children.length; n++) {
                    var r = e._children[n];
                    r.__dirty = e.__dirty || r.__dirty,
                    this._updateAndAddShape(r, t)
                }
                e.__dirty = !1
            } else e.__clipShapes = t,
            this._shapeList[this._shapeListOffset++] = e
        },
        s.prototype.mod = function(e, n) {
            typeof e == "string" && (e = this._elements[e]);
            if (e) {
                e.modSelf();
                if (n) if (n.parent || n._storage || n.__clipShapes) {
                    var r = {};
                    for (var i in n) {
                        if (i === "parent" || i === "_storage" || i === "__clipShapes") continue;
                        n.hasOwnProperty(i) && (r[i] = n[i])
                    }
                    t.merge(e, r, !0)
                } else t.merge(e, n, !0)
            }
            return this
        },
        s.prototype.drift = function(e, t, n) {
            var r = this._elements[e];
            return r && (r.needTransform = !0, r.draggable === "horizontal" ? n = 0 : r.draggable === "vertical" && (t = 0), (!r.ondrift || r.ondrift && !r.ondrift(t, n)) && r.drift(t, n)),
            this
        },
        s.prototype.addHover = function(e) {
            return e.updateNeedTransform(),
            this._hoverElements.push(e),
            this
        },
        s.prototype.delHover = function() {
            return this._hoverElements = [],
            this
        },
        s.prototype.hasHoverShape = function() {
            return this._hoverElements.length > 0
        },
        s.prototype.addRoot = function(e) {
            if (this._elements[e.id]) return;
            e instanceof n && e.addChildrenToStorage(this),
            this.addToMap(e),
            this._roots.push(e)
        },
        s.prototype.delRoot = function(e) {
            if (typeof e == "undefined") {
                for (var r = 0; r < this._roots.length; r++) {
                    var i = this._roots[r];
                    i instanceof n && i.delChildrenFromStorage(this)
                }
                this._elements = {},
                this._hoverElements = [],
                this._roots = [],
                this._shapeList = [],
                this._shapeListOffset = 0;
                return
            }
            if (e instanceof Array) {
                for (var r = 0,
                s = e.length; r < s; r++) this.delRoot(e[r]);
                return
            }
            var o;
            typeof e == "string" ? o = this._elements[e] : o = e;
            var u = t.indexOf(this._roots, o);
            u >= 0 && (this.delFromMap(o.id), this._roots.splice(u, 1), o instanceof n && o.delChildrenFromStorage(this))
        },
        s.prototype.addToMap = function(e) {
            return e instanceof n && (e._storage = this),
            e.modSelf(),
            this._elements[e.id] = e,
            this
        },
        s.prototype.get = function(e) {
            return this._elements[e]
        },
        s.prototype.delFromMap = function(e) {
            var t = this._elements[e];
            return t && (delete this._elements[e], t instanceof n && (t._storage = null)),
            this
        },
        s.prototype.dispose = function() {
            this._elements = this._renderList = this._roots = this._hoverElements = null
        },
        s
    }),
    //缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js
    r("zrender/animation/easing", [], function() {
        var e = {
            Linear: function(e) {
                return e
            },
            QuadraticIn: function(e) {
                return e * e
            },
            QuadraticOut: function(e) {
                return e * (2 - e)
            },
            QuadraticInOut: function(e) {
                return (e *= 2) < 1 ? .5 * e * e: -0.5 * (--e * (e - 2) - 1)
            },
            CubicIn: function(e) {
                return e * e * e
            },
            CubicOut: function(e) {
                return--e * e * e + 1
            },
            CubicInOut: function(e) {
                return (e *= 2) < 1 ? .5 * e * e * e: .5 * ((e -= 2) * e * e + 2)
            },
            QuarticIn: function(e) {
                return e * e * e * e
            },
            QuarticOut: function(e) {
                return 1 - --e * e * e * e
            },
            QuarticInOut: function(e) {
                return (e *= 2) < 1 ? .5 * e * e * e * e: -0.5 * ((e -= 2) * e * e * e - 2)
            },
            QuinticIn: function(e) {
                return e * e * e * e * e
            },
            QuinticOut: function(e) {
                return--e * e * e * e * e + 1
            },
            QuinticInOut: function(e) {
                return (e *= 2) < 1 ? .5 * e * e * e * e * e: .5 * ((e -= 2) * e * e * e * e + 2)
            },
            SinusoidalIn: function(e) {
                return 1 - Math.cos(e * Math.PI / 2)
            },
            SinusoidalOut: function(e) {
                return Math.sin(e * Math.PI / 2)
            },
            SinusoidalInOut: function(e) {
                return.5 * (1 - Math.cos(Math.PI * e))
            },
            ExponentialIn: function(e) {
                return e === 0 ? 0 : Math.pow(1024, e - 1)
            },
            ExponentialOut: function(e) {
                return e === 1 ? 1 : 1 - Math.pow(2, -10 * e)
            },
            ExponentialInOut: function(e) {
                return e === 0 ? 0 : e === 1 ? 1 : (e *= 2) < 1 ? .5 * Math.pow(1024, e - 1) : .5 * ( - Math.pow(2, -10 * (e - 1)) + 2)
            },
            CircularIn: function(e) {
                return 1 - Math.sqrt(1 - e * e)
            },
            CircularOut: function(e) {
                return Math.sqrt(1 - --e * e)
            },
            CircularInOut: function(e) {
                return (e *= 2) < 1 ? -0.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1)
            },
            ElasticIn: function(e) {
                var t, n = .1,
                r = .4;
                return e === 0 ? 0 : e === 1 ? 1 : (!n || n < 1 ? (n = 1, t = r / 4) : t = r * Math.asin(1 / n) / (2 * Math.PI), -(n * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * 2 * Math.PI / r)))
            },
            ElasticOut: function(e) {
                var t, n = .1,
                r = .4;
                return e === 0 ? 0 : e === 1 ? 1 : (!n || n < 1 ? (n = 1, t = r / 4) : t = r * Math.asin(1 / n) / (2 * Math.PI), n * Math.pow(2, -10 * e) * Math.sin((e - t) * 2 * Math.PI / r) + 1)
            },
            ElasticInOut: function(e) {
                var t, n = .1,
                r = .4;
                return e === 0 ? 0 : e === 1 ? 1 : (!n || n < 1 ? (n = 1, t = r / 4) : t = r * Math.asin(1 / n) / (2 * Math.PI), (e *= 2) < 1 ? -0.5 * n * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * 2 * Math.PI / r) : n * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - t) * 2 * Math.PI / r) * .5 + 1)
            },
            BackIn: function(e) {
                var t = 1.70158;
                return e * e * ((t + 1) * e - t)
            },
            BackOut: function(e) {
                var t = 1.70158;
                return--e * e * ((t + 1) * e + t) + 1
            },
            BackInOut: function(e) {
                var t = 2.5949095;
                return (e *= 2) < 1 ? .5 * e * e * ((t + 1) * e - t) : .5 * ((e -= 2) * e * ((t + 1) * e + t) + 2)
            },
            BounceIn: function(t) {
                return 1 - e.BounceOut(1 - t)
            },
            BounceOut: function(e) {
                return e < 1 / 2.75 ? 7.5625 * e * e: e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
            },
            BounceInOut: function(t) {
                return t < .5 ? e.BounceIn(t * 2) * .5 : e.BounceOut(t * 2 - 1) * .5 + .5
            }
        };
        return e
    }),
    //
    r("zrender/animation/Clip", ["require", "./easing"], function(e) {
        function n(e) {
            this._targetPool = e.target || {},
            this._targetPool instanceof Array || (this._targetPool = [this._targetPool]),
            this._life = e.life || 1e3,
            this._delay = e.delay || 0,
            this._startTime = (new Date).getTime() + this._delay,
            this._endTime = this._startTime + this._life * 1e3,
            this.loop = typeof e.loop == "undefined" ? !1 : e.loop,
            this.gap = e.gap || 0,
            this.easing = e.easing || "Linear",
            this.onframe = e.onframe,
            this.ondestroy = e.ondestroy,
            this.onrestart = e.onrestart
        }
        var t = e("./easing");
        return n.prototype = {
            step: function(e) {
                var n = (e - this._startTime) / this._life;
                if (n < 0) return;
                n = Math.min(n, 1);
                var r = typeof this.easing == "string" ? t[this.easing] : this.easing,
                i = typeof r == "function" ? r(n) : n;
                return this.fire("frame", i),
                n == 1 ? this.loop ? (this.restart(), "restart") : (this._needsRemove = !0, "destroy") : null
            },
            restart: function() {
                var e = (new Date).getTime(),
                t = (e - this._startTime) % this._life;
                this._startTime = (new Date).getTime() - t + this.gap,
                this._needsRemove = !1
            },
            fire: function(e, t) {
                for (var n = 0,
                r = this._targetPool.length; n < r; n++) this["on" + e] && this["on" + e](this._targetPool[n], t)
            },
            constructor: n
        },
        n
    }),
    //动画主类, 调度和管理所有动画控制器
    r("zrender/animation/Animation", ["require", "./Clip", "../tool/color", "../tool/util", "../tool/event"],
    function(e) {
        function a(e, t) {
            return e[t]
        }
        function f(e, t, n) {
            e[t] = n
        }
        function l(e, t, n) {
            return (t - e) * n + e
        }
        function c(e, t, n, r, i) {
            var s = e.length;
            if (i == 1) for (var o = 0; o < s; o++) r[o] = l(e[o], t[o], n);
            else {
                var u = e[0].length;
                for (var o = 0; o < s; o++) for (var a = 0; a < u; a++) r[o][a] = l(e[o][a], t[o][a], n)
            }
        }
        function h(e) {
            switch (typeof e) {
            case "undefined":
            case "string":
                return ! 1
            }
            return typeof e.length != "undefined"
        }
        function p(e, t, n, r, i, s, o, u, a) {
            var f = e.length;
            if (a == 1) for (var l = 0; l < f; l++) u[l] = d(e[l], t[l], n[l], r[l], i, s, o);
            else {
                var c = e[0].length;
                for (var l = 0; l < f; l++) for (var h = 0; h < c; h++) u[l][h] = d(e[l][h], t[l][h], n[l][h], r[l][h], i, s, o)
            }
        }
        function d(e, t, n, r, i, s, o) {
            var u = (n - e) * .5,
            a = (r - t) * .5;
            return (2 * (t - n) + u + a) * o + ( - 3 * (t - n) - 2 * u - a) * s + u * i + t
        }
        function v(e) {
            if (h(e)) {
                var t = e.length;
                if (h(e[0])) {
                    var n = [];
                    for (var r = 0; r < t; r++) n.push(o.call(e[r]));
                    return n
                }
                return o.call(e)
            }
            return e
        }
        function m(e) {
            return e[0] = Math.floor(e[0]),
            e[1] = Math.floor(e[1]),
            e[2] = Math.floor(e[2]),
            "rgba(" + e.join(",") + ")"
        }
        var t = e("./Clip"),
        n = e("../tool/color"),
        r = e("../tool/util"),
        i = e("../tool/event").Dispatcher,
        s = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
        function(e) {
            setTimeout(e, 16)
        },
        o = Array.prototype.slice,
        u = function(e) {
            e = e || {},
            this.stage = e.stage || {},
            this.onframe = e.onframe ||
            function() {},
            this._clips = [],
            this._running = !1,
            this._time = 0,
            i.call(this)
        };
        u.prototype = {
            add: function(e) {
                this._clips.push(e)
            },
            remove: function(e) {
                var t = r.indexOf(this._clips, e);
                t >= 0 && this._clips.splice(t, 1)
            },
            _update: function() {
                var e = (new Date).getTime(),
                t = e - this._time,
                n = this._clips,
                r = n.length,
                i = [],
                s = [];
                for (var o = 0; o < r; o++) {
                    var u = n[o],
                    a = u.step(e);
                    a && (i.push(a), s.push(u))
                }
                for (var o = 0; o < r;) n[o]._needsRemove ? (n[o] = n[r - 1], n.pop(), r--) : o++;
                r = i.length;
                for (var o = 0; o < r; o++) s[o].fire(i[o]);
                this._time = e,
                this.onframe(t),
                this.dispatch("frame", t),
                this.stage.update && this.stage.update()
            },
            start: function() {
                function t() {
                    e._running && (s(t), e._update())
                }
                var e = this;
                this._running = !0,
                this._time = (new Date).getTime(),
                s(t)
            },
            stop: function() {
                this._running = !1
            },
            clear: function() {
                this._clips = []
            },
            animate: function(e, t) {
                t = t || {};
                var n = new g(e, t.loop, t.getter, t.setter);
                return n.animation = this,
                n
            },
            constructor: u
        },
        r.merge(u.prototype, i.prototype, !0);
        var g = function(e, t, n, r) {
            this._tracks = {},
            this._target = e,
            this._loop = t || !1,
            this._getter = n || a,
            this._setter = r || f,
            this._clipCount = 0,
            this._delay = 0,
            this._doneList = [],
            this._onframeList = [],
            this._clipList = []
        };
        return g.prototype = {
            when: function(e, t) {
                for (var n in t) this._tracks[n] || (this._tracks[n] = [], e !== 0 && this._tracks[n].push({
                    time: 0,
                    value: v(this._getter(this._target, n))
                })),
                this._tracks[n].push({
                    time: parseInt(e, 10),
                    value: t[n]
                });
                return this
            },
            during: function(e) {
                return this._onframeList.push(e),
                this
            },
            start: function(e) {
                var r = this,
                i = this._setter,
                s = this._getter,
                o = e === "spline",
                u = function() {
                    r._clipCount--;
                    if (r._clipCount === 0) {
                        r._tracks = {};
                        var e = r._doneList.length;
                        for (var t = 0; t < e; t++) r._doneList[t].call(r)
                    }
                },
                a = function(a, f) {
                    var v = a.length;
                    if (!v) return;
                    var g = a[0].value,
                    y = h(g),
                    b = !1,
                    w = y && h(g[0]) ? 2 : 1;
                    a.sort(function(e, t) {
                        return e.time - t.time
                    });
                    var E;
                    if (!v) return;
                    E = a[v - 1].time;
                    var S = [],
                    x = [];
                    for (var T = 0; T < v; T++) {
                        S.push(a[T].time / E);
                        var N = a[T].value;
                        typeof N == "string" && (N = n.toArray(N), N.length === 0 && (N[0] = N[1] = N[2] = 0, N[3] = 1), b = !0),
                        x.push(N)
                    }
                    var C = 0,
                    k = 0,
                    L, T, A, O, M, _, D;
                    if (b) var P = [0, 0, 0, 0];
                    var H = function(e, t) {
                        if (t < k) {
                            L = Math.min(C + 1, v - 1);
                            for (T = L; T >= 0; T--) if (S[T] <= t) break;
                            T = Math.min(T, v - 2)
                        } else {
                            for (T = C; T < v; T++) if (S[T] > t) break;
                            T = Math.min(T - 1, v - 2)
                        }
                        C = T,
                        k = t;
                        var n = S[T + 1] - S[T];
                        if (n === 0) return;
                        A = (t - S[T]) / n;
                        if (o) {
                            M = x[T],
                            O = x[T === 0 ? T: T - 1],
                            _ = x[T > v - 2 ? v - 1 : T + 1],
                            D = x[T > v - 3 ? v - 1 : T + 2];
                            if (y) p(O, M, _, D, A, A * A, A * A * A, s(e, f), w);
                            else {
                                var u;
                                b ? (u = p(O, M, _, D, A, A * A, A * A * A, P, 1), u = m(P)) : u = d(O, M, _, D, A, A * A, A * A * A),
                                i(e, f, u)
                            }
                        } else if (y) c(x[T], x[T + 1], A, s(e, f), w);
                        else {
                            var u;
                            b ? (c(x[T], x[T + 1], A, P, 1), u = m(P)) : u = l(x[T], x[T + 1], A),
                            i(e, f, u)
                        }
                        for (T = 0; T < r._onframeList.length; T++) r._onframeList[T](e, t)
                    },
                    B = new t({
                        target: r._target,
                        life: E,
                        loop: r._loop,
                        delay: r._delay,
                        onframe: H,
                        ondestroy: u
                    });
                    e && e !== "spline" && (B.easing = e),
                    r._clipList.push(B),
                    r._clipCount++,
                    r.animation.add(B)
                };
                for (var f in this._tracks) a(this._tracks[f], f);
                return this
            },
            stop: function() {
                for (var e = 0; e < this._clipList.length; e++) {
                    var t = this._clipList[e];
                    this.animation.remove(t)
                }
                this._clipList = []
            },
            delay: function(e) {
                return this._delay = e,
                this
            },
            done: function(e) {
                return e && this._doneList.push(e),
                this
            }
        },
        u
    }),
    //ZRender接口类，对外可用的所有接口都在这里 非get接口统一返回支持链式调用
    r("zrender/zrender", ["require", "./dep/excanvas", "./tool/util", "./tool/log", "./tool/guid", "./Handler", "./Painter", "./Storage", "./animation/Animation", "./tool/env"],
    function(e) {
        function l(e) {
            return function() {
                var t = e.animatingElements;
                for (var n = 0,
                r = t.length; n < r; n++) e.storage.mod(t[n].id); (t.length || e._needsRefreshNextFrame) && e.refresh()
            }
        }
        e("./dep/excanvas");
        var t = e("./tool/util"),
        n = e("./tool/log"),
        r = e("./tool/guid"),
        i = e("./Handler"),
        s = e("./Painter"),
        o = e("./Storage"),
        u = e("./animation/Animation"),
        a = {},
        f = {};
        f.version = "2.0.7",
        f.init = function(e) {
            var t = new c(r(), e);
            return a[t.id] = t,
            t
        },
        f.dispose = function(e) {
            if (e) e.dispose();
            else {
                for (var t in a) a[t].dispose();
                a = {}
            }
            return f
        },
        f.getInstance = function(e) {
            return a[e]
        },
        f.delInstance = function(e) {
            return delete a[e],
            f
        };
        var c = function(t, n) {
            this.id = t,
            this.env = e("./tool/env"),
            this.storage = new o,
            this.painter = new s(n, this.storage),
            this.handler = new i(n, this.storage, this.painter),
            this.animatingElements = [],
            this.animation = new u({
                stage: {
                    update: l(this)
                }
            }),
            this.animation.start();
            var r = this;
            this.painter.refreshNextFrame = function() {
                r.refreshNextFrame()
            },
            this._needsRefreshNextFrame = !1;
            var r = this,
            a = this.storage,
            f = a.delFromMap;
            a.delFromMap = function(e) {
                var t = a.get(e);
                r.stopAnimation(t),
                f.call(a, e)
            }
        };
        return c.prototype.getId = function() {
            return this.id
        },
        c.prototype.addShape = function(e) {
            return this.addElement(e),
            this
        },
        c.prototype.addGroup = function(e) {
            return this.addElement(e),
            this
        },
        c.prototype.delShape = function(e) {
            return this.delElement(e),
            this
        },
        c.prototype.delGroup = function(e) {
            return this.delElement(e),
            this
        },
        c.prototype.modShape = function(e, t) {
            return this.modElement(e, t),
            this
        },
        c.prototype.modGroup = function(e, t) {
            return this.modElement(e, t),
            this
        },
        c.prototype.addElement = function(e) {
            return this.storage.addRoot(e),
            this._needsRefreshNextFrame = !0,
            this
        },
        c.prototype.delElement = function(e) {
            return this.storage.delRoot(e),
            this._needsRefreshNextFrame = !0,
            this
        },
        c.prototype.modElement = function(e, t) {
            return this.storage.mod(e, t),
            this._needsRefreshNextFrame = !0,
            this
        },
        c.prototype.modLayer = function(e, t) {
            return this.painter.modLayer(e, t),
            this._needsRefreshNextFrame = !0,
            this
        },
        c.prototype.addHoverShape = function(e) {
            return this.storage.addHover(e),
            this
        },
        c.prototype.render = function(e) {
            return this.painter.render(e),
            this._needsRefreshNextFrame = !1,
            this
        },
        c.prototype.refresh = function(e) {
            return this.painter.refresh(e),
            this._needsRefreshNextFrame = !1,
            this
        },
        c.prototype.refreshNextFrame = function() {
            return this._needsRefreshNextFrame = !0,
            this
        },
        c.prototype.refreshHover = function(e) {
            return this.painter.refreshHover(e),
            this
        },
        c.prototype.refreshShapes = function(e, t) {
            return this.painter.refreshShapes(e, t),
            this
        },
        c.prototype.resize = function() {
            return this.painter.resize(),
            this
        },
        c.prototype.animate = function(e, r, i) {
            typeof e == "string" && (e = this.storage.get(e));
            if (e) {
                var s;
                if (r) {
                    var o = r.split("."),
                    u = e;
                    for (var a = 0,
                    f = o.length; a < f; a++) {
                        if (!u) continue;
                        u = u[o[a]]
                    }
                    u && (s = u)
                } else s = e;
                if (!s) {
                    n('Property "' + r + '" is not existed in element ' + e.id);
                    return
                }
                var l = this.animatingElements;
                e.__animators == null && (e.__animators = []);
                var c = e.__animators;
                c.length === 0 && l.push(e);
                var h = this.animation.animate(s, {
                    loop: i
                }).done(function() {
                    c.splice(e.__animators.indexOf(h), 1);
                    if (c.length === 0) {
                        var n = t.indexOf(l, e);
                        l.splice(n, 1)
                    }
                });
                return c.push(h),
                h
            }
            n("Element not existed")
        },
        c.prototype.stopAnimation = function(e) {
            if (e.__animators) {
                var t = e.__animators,
                n = t.length;
                for (var r = 0; r < n; r++) t[r].stop();
                if (n > 0) {
                    var i = this.animatingElements;
                    i.splice(i.indexOf(e), 1)
                }
                t.length = 0
            }
            return this
        },
        c.prototype.clearAnimation = function() {
            return this.animation.clear(),
            this.animatingElements.length = 0,
            this
        },
        c.prototype.showLoading = function(e) {
            return this.painter.showLoading(e),
            this
        },
        c.prototype.hideLoading = function() {
            return this.painter.hideLoading(),
            this
        },
        c.prototype.getWidth = function() {
            return this.painter.getWidth()
        },
        c.prototype.getHeight = function() {
            return this.painter.getHeight()
        },
        c.prototype.toDataURL = function(e, t, n) {
            return this.painter.toDataURL(e, t, n)
        },
        c.prototype.shapeToImage = function(e, t, n) {
            var i = r();
            return this.painter.shapeToImage(i, e, t, n)
        },
        c.prototype.on = function(e, t, n) {
            return this.handler.on(e, t, n),
            this
        },
        c.prototype.un = function(e, t) {
            return this.handler.un(e, t),
            this
        },
        c.prototype.trigger = function(e, t) {
            return this.handler.trigger(e, t),
            this
        },
        c.prototype.clear = function() {
            return this.storage.delRoot(),
            this.painter.clear(),
            this
        },
        c.prototype.dispose = function() {
            this.animation.stop(),
            this.clear(),
            this.storage.dispose(),
            this.painter.dispose(),
            this.handler.dispose(),
            this.animation = this.animatingElements = this.storage = this.painter = this.handler = null,
            f.delInstance(this.id)
        },
        f
    }),
    r("zrender", ["zrender/zrender"], function(e) {
        return e
    }),
    r("echarts/data/Graph", ["require", "zrender/tool/util"],function(e) {
        var t = e("zrender/tool/util"),
        n = function(e) {
            this._directed = e || !1,
            this.nodes = [],
            this.edges = [],
            this._nodesMap = {},
            this._edgesMap = {}
        };
        n.prototype.isDirected = function() {
            return this._directed
        },
        n.prototype.addNode = function(e, t) {
            if (this._nodesMap[e]) return this._nodesMap[e];
            var r = new n.Node(e, t);
            return this.nodes.push(r),
            this._nodesMap[e] = r,
            r
        },
        n.prototype.getNodeById = function(e) {
            return this._nodesMap[e]
        },
        n.prototype.addEdge = function(e, t, r) {
            typeof e == "string" && (e = this._nodesMap[e]),
            typeof t == "string" && (t = this._nodesMap[t]);
            if (!e || !t) return;
            var i = e.id + "-" + t.id;
            if (this._edgesMap[i]) return this._edgesMap[i];
            var s = new n.Edge(e, t, r);
            return this._directed && (e.outEdges.push(s), t.inEdges.push(s)),
            e.edges.push(s),
            e !== t && t.edges.push(s),
            this.edges.push(s),
            this._edgesMap[i] = s,
            s
        },
        n.prototype.removeEdge = function(e) {
            var n = e.node1,
            r = e.node2,
            i = n.id + "-" + r.id;
            this._directed && (n.outEdges.splice(t.indexOf(n.outEdges, e), 1), r.inEdges.splice(t.indexOf(r.inEdges, e), 1)),
            n.edges.splice(t.indexOf(n.edges, e), 1),
            n !== r && r.edges.splice(t.indexOf(r.edges, e), 1),
            delete this._edgesMap[i],
            this.edges.splice(t.indexOf(this.edges, e), 1)
        },
        n.prototype.getEdge = function(e, t) {
            return typeof e != "string" && (e = e.id),
            typeof t != "string" && (t = t.id),
            this._directed ? this._edgesMap[e + "-" + t] : this._edgesMap[e + "-" + t] || this._edgesMap[t + "-" + e]
        },
        n.prototype.removeNode = function(e) {
            if (typeof e == "string") {
                e = this._nodesMap[e];
                if (!e) return
            }
            delete this._nodesMap[e.id],
            this.nodes.splice(t.indexOf(this.nodes, e), 1);
            for (var n = 0; n < this.edges.length;) {
                var r = this.edges[n];
                r.node1 === e || r.node2 === e ? this.removeEdge(r) : n++
            }
        },
        n.prototype.filterNode = function(e, t) {
            var n = this.nodes.length;
            for (var r = 0; r < n;) e.call(t, this.nodes[r], r) ? r++:(this.removeNode(this.nodes[r]), n--)
        },
        n.prototype.filterEdge = function(e, t) {
            var n = this.edges.length;
            for (var r = 0; r < n;) e.call(t, this.edges[r], r) ? r++:(this.removeEdge(this.edges[r]), n--)
        },
        n.prototype.eachNode = function(e, t) {
            var n = this.nodes.length;
            for (var r = 0; r < n; r++) this.nodes[r] && e.call(t, this.nodes[r], r)
        },
        n.prototype.eachEdge = function(e, t) {
            var n = this.edges.length;
            for (var r = 0; r < n; r++) this.edges[r] && e.call(t, this.edges[r], r)
        },
        n.prototype.clear = function() {
            this.nodes.length = 0,
            this.edges.length = 0,
            this._nodesMap = {},
            this._edgesMap = {}
        },
        n.prototype.breadthFirstTraverse = function(e, t, n, r) {
            typeof t == "string" && (t = this._nodesMap[t]);
            if (!t) return;
            var i = "edges";
            n === "out" ? i = "outEdges": n === "in" && (i = "inEdges");
            for (var s = 0; s < this.nodes.length; s++) this.nodes[s].__visited = !1;
            if (e.call(r, t, null)) return;
            var o = [t];
            while (o.length) {
                var u = o.shift(),
                a = u[i];
                for (var s = 0; s < a.length; s++) {
                    var f = a[s],
                    l = f.node1 === u ? f.node2: f.node1;
                    if (!l.__visited) {
                        if (e.call(l, l, u)) return;
                        o.push(l),
                        l.__visited = !0
                    }
                }
            }
        },
        n.prototype.clone = function() {
            var e = new n(this._directed);
            for (var t = 0; t < this.nodes.length; t++) e.addNode(this.nodes[t].id, this.nodes[t].data);
            for (var t = 0; t < this.edges.length; t++) {
                var r = this.edges[t];
                e.addEdge(r.node1.id, r.node2.id, r.data)
            }
            return e
        };
        var r = function(e, t) {
            this.id = e,
            this.data = t || null,
            this.inEdges = [],
            this.outEdges = [],
            this.edges = []
        };
        r.prototype.degree = function() {
            return this.edges.length
        },
        r.prototype.inDegree = function() {
            return this.inEdges.length
        },
        r.prototype.outDegree = function() {
            return this.outEdges.length
        };
        var i = function(e, t, n) {
            this.node1 = e,
            this.node2 = t,
            this.data = n || null
        };
        return n.Node = r,
        n.Edge = i,
        n.fromMatrix = function(e, t, r) {
            if (!t || !t.length || t[0].length !== t.length || e.length !== t.length) return;
            var i = t.length,
            s = new n(r);
            for (var o = 0; o < i; o++) {
                var u = s.addNode(e[o].id, e[o]);
                u.data.value = 0,
                r && (u.data.outValue = u.data.inValue = 0)
            }
            for (var o = 0; o < i; o++) for (var a = 0; a < i; a++) {
                var f = t[o][a];
                r && (s.nodes[o].data.outValue += f, s.nodes[a].data.inValue += f),
                s.nodes[o].data.value += f,
                s.nodes[a].data.value += f
            }
            for (var o = 0; o < i; o++) for (var a = o; a < i; a++) {
                var f = t[o][a];
                if (f === 0) continue;
                var l = s.nodes[o],
                c = s.nodes[a],
                h = s.addEdge(l, c, {});
                h.data.weight = f;
                if (o !== a && r && t[a][o]) {
                    var p = s.addEdge(c, l, {});
                    p.data.weight = t[a][o]
                }
            }
            return s
        },
        n
    }),
    r("echarts/data/Tree", ["require"], function(e) {
        function t(e) {
            this.id = e,
            this.depth = 0,
            this.height = 0,
            this.children = []
        }
        function n(e) {
            this.root = new t(e)
        }
        return t.prototype.traverse = function(e, t) {
            e.call(t, this);
            for (var n = 0; n < this.children.length; n++) this.children[n].traverse(e, t)
        },
        t.prototype.updateDepthAndHeight = function(e) {
            var t = 0;
            this.depth = e;
            for (var n = 0; n < this.children.length; n++) {
                var r = this.children[n];
                r.updateDepthAndHeight(e + 1),
                r.height > t && (t = r.height)
            }
            this.height = t + 1
        },
        t.prototype.getNodeById = function(e) {
            if (this.id === e) return this;
            for (var t = 0; t < this.children.length; t++) {
                var n = this.children[t].getNodeById(e);
                if (n) return n
            }
        },
        n.prototype.traverse = function(e, t) {
            this.root.traverse(e, t)
        },
        n.prototype.getSubTree = function(e) {
            var t = this.getNodeById(e);
            if (t) {
                var r = new n(t.id);
                return r.root = t,
                r
            }
        },
        n.prototype.getNodeById = function(e) {
            return this.root.getNodeById(e)
        },
        n.fromGraph = function(e) {
            function r(t) {
                var n = e.getNodeById(t.id);
                for (var i = 0; i < n.outEdges.length; i++) {
                    var o = n.outEdges[i],
                    u = s[o.node2.id];
                    t.children.push(u),
                    r(u)
                }
            }
            var i = {},
            s = {};
            for (var o = 0; o < e.nodes.length; o++) {
                var u = e.nodes[o],
                a;
                u.inDegree() === 0 ? (i[u.id] = new n(u.id), a = i[u.id].root) : a = new t(u.id),
                a.data = u.data,
                s[u.id] = a
            }
            var f = [];
            for (var l in i) r(i[l].root),
            i[l].root.updateDepthAndHeight(0),
            f.push(i[l]);
            return f
        },
        n
    }),
    r("echarts/layout/Tree", ["require", "zrender/tool/vector"], function(e) {
        function n(e) {
            e = e || {},
            this.nodePadding = e.nodePadding || 30,
            this.layerPadding = e.layerPadding || 100,
            this._layerOffsets = [],
            this._layers = []
        }
        var t = e("zrender/tool/vector");
        return n.prototype.run = function(e) {
            this._layerOffsets.length = 0;
            for (var t = 0; t < e.root.height + 1; t++) this._layerOffsets[t] = 0,
            this._layers[t] = [];
            this._updateNodeXPosition(e.root);
            var n = e.root;
            this._updateNodeYPosition(n, 0, n.layout.height)
        },
        n.prototype._updateNodeXPosition = function(e) {
            var n = Infinity,
            r = -Infinity;
            e.layout.position = e.layout.position || t.create();
            for (var i = 0; i < e.children.length; i++) {
                var s = e.children[i];
                this._updateNodeXPosition(s);
                var o = s.layout.position[0];
                o < n && (n = o),
                o > r && (r = o)
            }
            e.children.length > 0 ? e.layout.position[0] = (n + r) / 2 : e.layout.position[0] = 0;
            var u = this._layerOffsets[e.depth] || 0;
            if (u > e.layout.position[0]) {
                var a = u - e.layout.position[0];
                this._shiftSubtree(e, a);
                for (var i = e.depth + 1; i < e.height + e.depth; i++) this._layerOffsets[i] += a
            }
            this._layerOffsets[e.depth] = e.layout.position[0] + e.layout.width + this.nodePadding,
            this._layers[e.depth].push(e)
        },
        n.prototype._shiftSubtree = function(e, t) {
            e.layout.position[0] += t;
            for (var n = 0; n < e.children.length; n++) this._shiftSubtree(e.children[n], t)
        },
        n.prototype._updateNodeYPosition = function(e, t, n) {
            e.layout.position[1] = t;
            var r = 0;
            for (var i = 0; i < e.children.length; i++) r = Math.max(e.children[i].layout.height, r);
            var s = this.layerPadding;
            typeof s == "function" && (s = s(e.depth));
            for (var i = 0; i < e.children.length; i++) this._updateNodeYPosition(e.children[i], t + s + n, r)
        },
        n
    }),
    r("zrender/shape/Circle", ["require", "./Base", "../tool/util"], function(e) {
        var t = e("./Base"),
        n = function(e) {
            t.call(this, e)
        };
        return n.prototype = {
            type: "circle",
            buildPath: function(e, t) {
                e.moveTo(t.x + t.r, t.y),
                e.arc(t.x, t.y, t.r, 0, Math.PI * 2, !0);
                return
            },
            getRect: function(e) {
                if (e.__rect) return e.__rect;
                var t;
                return e.brushType == "stroke" || e.brushType == "fill" ? t = e.lineWidth || 1 : t = 0,
                e.__rect = {
                    x: Math.round(e.x - e.r - t / 2),
                    y: Math.round(e.y - e.r - t / 2),
                    width: e.r * 2 + t,
                    height: e.r * 2 + t
                },
                e.__rect
            }
        },
        e("../tool/util").inherits(n, t),
        n
    }),
  //贝塞尔曲线
    r("zrender/shape/BezierCurve", ["require", "./Base", "../tool/util"], function(e) {
        var t = e("./Base"),
        n = function(e) {
            this.brushTypeOnly = "stroke",
            this.textPosition = "end",
            t.call(this, e)
        };
        return n.prototype = {
            type: "bezier-curve",
            buildPath: function(e, t) {
                e.moveTo(t.xStart, t.yStart),
                typeof t.cpX2 != "undefined" && typeof t.cpY2 != "undefined" ? e.bezierCurveTo(t.cpX1, t.cpY1, t.cpX2, t.cpY2, t.xEnd, t.yEnd) : e.quadraticCurveTo(t.cpX1, t.cpY1, t.xEnd, t.yEnd)
            },
            getRect: function(e) {
                if (e.__rect) return e.__rect;
                var t = Math.min(e.xStart, e.xEnd, e.cpX1),
                n = Math.min(e.yStart, e.yEnd, e.cpY1),
                r = Math.max(e.xStart, e.xEnd, e.cpX1),
                i = Math.max(e.yStart, e.yEnd, e.cpY1),
                s = e.cpX2,
                o = e.cpY2;
                typeof s != "undefined" && typeof o != "undefined" && (t = Math.min(t, s), n = Math.min(n, o), r = Math.max(r, s), i = Math.max(i, o));
                var u = e.lineWidth || 1;
                return e.__rect = {
                    x: t - u,
                    y: n - u,
                    width: r - t + u,
                    height: i - n + u
                },
                e.__rect
            }
        },
        e("../tool/util").inherits(n, t),
        n
    }),
    r("zrender/shape/util/dashedLineTo", [], function() {
        var e = [5, 5];
        return function(t, n, r, i, s, o) {
            if (t.setLineDash) {
                e[0] = e[1] = o,
                t.setLineDash(e),
                t.moveTo(n, r),
                t.lineTo(i, s);
                return
            }
            o = typeof o != "number" ? 5 : o;
            var u = i - n,
            a = s - r,
            f = Math.floor(Math.sqrt(u * u + a * a) / o);
            u /= f,
            a /= f;
            var l = !0;
            for (var c = 0; c < f; ++c) l ? t.moveTo(n, r) : t.lineTo(n, r),
            l = !l,
            n += u,
            r += a;
            t.lineTo(i, s)
        }
    }),
    r("zrender/shape/Line", ["require", "./Base", "./util/dashedLineTo", "../tool/util"], function(e) {
        var t = e("./Base"),
        n = e("./util/dashedLineTo"),
        r = function(e) {
            this.brushTypeOnly = "stroke",
            this.textPosition = "end",
            t.call(this, e)
        };
        return r.prototype = {
            type: "line",
            buildPath: function(e, t) {
                if (!t.lineType || t.lineType == "solid") e.moveTo(t.xStart, t.yStart),
                e.lineTo(t.xEnd, t.yEnd);
                else if (t.lineType == "dashed" || t.lineType == "dotted") {
                    var r = (t.lineWidth || 1) * (t.lineType == "dashed" ? 5 : 1);
                    n(e, t.xStart, t.yStart, t.xEnd, t.yEnd, r)
                }
            },
            getRect: function(e) {
                if (e.__rect) return e.__rect;
                var t = e.lineWidth || 1;
                return e.__rect = {
                    x: Math.min(e.xStart, e.xEnd) - t,
                    y: Math.min(e.yStart, e.yEnd) - t,
                    width: Math.abs(e.xStart - e.xEnd) + t,
                    height: Math.abs(e.yStart - e.yEnd) + t
                },
                e.__rect
            }
        },
        e("../tool/util").inherits(r, t),
        r
    }),
    /*bkgraph  start*/
    r("bkgraph/component/Component", ["require", "zrender/mixin/Eventful", "zrender/tool/util"], function(e) {
        var t = e("zrender/mixin/Eventful"),
        n = e("zrender/tool/util"),
        r = function() {
            t.call(this),
            this.el = document.createElement("div")
        };
        return r.prototype.type = "COMPONENT",
        r.prototype.initialize = function(e) {},
        r.prototype.resize = function(e, t) {},
        r.prototype.setData = function(e) {},
        r.prototype.dispose = function() {},
        n.merge(r.prototype, t.prototype, !0),
        r
    }),
    r("bkgraph/layout/forceLayoutWorker", ["require", "zrender/tool/vector"], function(e) {
        function r() {
            this.position = t.create(),
            this.force = t.create(),
            this.mass = 1,
            this.inDegree = 0,
            this.outDegree = 0
        }
        function i(e, t) {
            this.node1 = e,
            this.node2 = t,
            this.weight = 1
        }
        function s() {
            this.repulsionByDegree = !1,
            this.preventNodeOverlap = !1,
            this.preventNodeEdgeOverlap = !1,
            this.strongGravity = !0,
            this.scaling = 1,
            this.edgeWeightInfluence = 1,
            this.width = 500,
            this.height = 500,
            this.maxSpeedIncrease = 1,
            this.nodes = [],
            this.edges = [],
            this.bbox = new n(4),
            this.layerDistance = [0],
            this.layerConstraint = 0,
            this.edgeLength = 150,
            this._k = 0
        }
        var t = e("zrender/tool/vector"),
        n = typeof Float32Array == "undefined" ? Array: Float32Array;
        return s.prototype.nodeToNodeRepulsionFactor = function(e, t, n) {
            return n * n * e / t
        },
        s.prototype.edgeToNodeRepulsionFactor = function(e, t, n) {
            return n * e / t
        },
        s.prototype.attractionFactor = function(e, t, n) {
            return e * t / n * t / this.edgeLength
        },
        s.prototype.initNodes = function(e) {
            this.temperature = 1;
            var n = e.length;
            this.nodes.length = 0;
            for (var i = 0; i < n; i++) {
                var s = new r;
                s.mass = e[i].mass,
                s.size = e[i].size,
                s.layer = e[i].layer,
                s.fixed = e[i].fixed || !1,
                t.copy(s.position, e[i].position),
                this.nodes.push(s)
            }
        },
        s.prototype.initEdges = function(e) {
            var t = e.length;
            this.edges.length = 0;
            for (var n = 0; n < t; n++) {
                var r = e[n],
                s = r.node1Index,
                o = r.node2Index,
                u = this.nodes[s],
                a = this.nodes[o];
                if (!u || !a) continue;
                u.outDegree++,
                a.inDegree++;
                var f = new i(u, a);
                f.weight = r.weight,
                this.edges.push(f)
            }
        },
        s.prototype.update = function() {
            var e = this.nodes.length;
            this._k = .4 * this.scaling * Math.sqrt(this.width * this.height / e),
            this.updateForce(),
            this.updatePosition()
        },
        s.prototype.updateForce = function() {
            var e = this.nodes.length;
            for (var n = 0; n < e; n++) {
                var r = this.nodes[n];
                t.set(r.force, 0, 0)
            }
            this.updateNodeNodeForce(),
            this.updateLayerConstraintForce(),
            this.updateEdgeForce(),
            this.preventNodeEdgeOverlap && this.updateNodeEdgeForce()
        },
        s.prototype.updatePosition = function() {
            var e = this.nodes.length,
            n = t.create();
            for (var r = 0; r < e; r++) {
                var i = this.nodes[r];
                if (i.fixed) continue;
                var s = t.len(i.force),
                o = Math.min(s / 5, 1) * 5 / s;
                t.scale(i.force, i.force, o),
                t.add(i.position, i.position, i.force)
            }
        },
        s.prototype.updateNodeNodeForce = function() {
            var e = this.nodes.length;
            for (var t = 0; t < e; t++) {
                var n = this.nodes[t];
                if (this.barnesHutOptimize) this.applyRegionToNodeRepulsion(this._rootRegion, n);
                else for (var r = t + 1; r < e; r++) {
                    var i = this.nodes[r];
                    this.applyNodeToNodeRepulsion(n, i, !1)
                }
            }
        },
        s.prototype.updateLayerConstraintForce = function() {
            for (var e = 0; e < this.nodes.length; e++) this.applyNodeLayerConstraint(this.nodes[e])
        },
        s.prototype.updateEdgeForce = function() {
            for (var e = 0; e < this.edges.length; e++) this.applyEdgeAttraction(this.edges[e])
        },
        s.prototype.updateNodeEdgeForce = function() {
            for (var e = 0; e < this.nodes.length; e++) for (var t = 0; t < this.edges.length; t++) this.applyEdgeToNodeRepulsion(this.edges[t], this.nodes[e])
        },
        s.prototype.applyNodeToNodeRepulsion = function() {
            var e = t.create();
            return function(r, i, s) {
                if (r === i) return;
                if (r.mass === 0 && i.mass === 0) return;
                t.sub(e, r.position, i.position);
                var o = e[0] * e[0] + e[1] * e[1];
                if (o === 0) return;
                var u, a = r.mass + i.mass,
                f = Math.sqrt(o);
                t.scale(e, e, 1 / f),
                this.preventNodeOverlap ? (f = f - r.size - i.size, f > 0 ? u = this.nodeToNodeRepulsionFactor(a, f, this._k) : f <= 0 && (u = this._k * this._k * 10 * a)) : u = this.nodeToNodeRepulsionFactor(a, f, this._k),
                s || t.scaleAndAdd(r.force, r.force, e, u * 2),
                t.scaleAndAdd(i.force, i.force, e, -u * 2)
            }
        } (),
        s.prototype.applyEdgeAttraction = function() {
            var e = t.create();
            return function(r) {
                var i = r.node1,
                s = r.node2;
                t.sub(e, i.position, s.position);
                var o = t.len(e),
                u;
                this.edgeWeightInfluence === 0 ? u = 1 : this.edgeWeightInfluence == 1 ? u = r.weight: u = Math.pow(r.weight, this.edgeWeightInfluence);
                var a;
                if (this.preventOverlap) {
                    o = o - i.size - s.size;
                    if (o <= 0) return
                }
                var a = this.attractionFactor(u, o, this._k);
                t.scaleAndAdd(i.force, i.force, e, -a),
                t.scaleAndAdd(s.force, s.force, e, a)
            }
        } (),
        s.prototype.applyNodeLayerConstraint = function() {
            var e = t.create();
            return function(n) {
                t.sub(e, this.center, n.position);
                var r = t.len(e) + .001;
                t.scale(e, e, 1 / r),
                r -= this.layerDistance[n.layer];
                var i = this.layerConstraint[n.layer];
                t.scaleAndAdd(n.force, n.force, e, r * r * i * n.mass)
            }
        } (),
        s.prototype.applyEdgeToNodeRepulsion = function() {
            var e = t.create(),
            n = t.create(),
            r = t.create();
            return function(i, s) {
                var o = i.node1,
                u = i.node2;
                if (o === s || u === s) return;
                t.sub(e, u.position, o.position),
                t.sub(n, s.position, o.position);
                var a = t.len(e);
                if (a === 0) return;
                t.scale(e, e, 1 / a);
                var f = t.dot(e, n);
                if (f < 0 || f > a) return;
                t.scaleAndAdd(r, o.position, e, f);
                var l = t.dist(r, s.position) - s.size;
                if (l < 10) var c = 1e5 * (20 - l);
                else var c = this.edgeToNodeRepulsionFactor(s.mass, l, 1e3);
                t.sub(e, s.position, r),
                t.normalize(e, e),
                t.scaleAndAdd(s.force, s.force, e, c)
            }
        } (),
        s.prototype.setToken = function(e) {
            this._token = e
        },
        s.prototype.tokenMatch = function(e) {
            return e === this._token
        },
        s
    }),
    r("bkgraph/layout/ForceLayout", ["require", "./forceLayoutWorker", "zrender/tool/vector"], function(e) {
        function s() {
            return Math.round((new Date).getTime() / 100) % 1e7
        }
        var t = e("./forceLayoutWorker"),
        n = e("zrender/tool/vector"),
        r = typeof Float32Array == "undefined" ? Array: Float32Array,
        i,
        o = function(e) {
            e = e || {},
            this.width = e.width || 500,
            this.height = e.height || 500,
            this.center = e.center || [this.width / 2, this.height / 2],
            this.ratioScaling = e.ratioScaling || !1,
            this.scaling = e.scaling || 1,
            this.large = e.large || !1,
            this.preventNodeOverlap = e.preventNodeOverlap || !1,
            this.preventNodeEdgeOverlap = e.preventNodeEdgeOverlap || !1,
            this.layerConstraint = 0,
            this.layerDistance = [0],
            this.edgeLength = 150,
            this.onupdate = e.onupdate ||
            function() {},
            this.onstable = e.onstable ||
            function() {},
            this.stableThreshold = 10,
            this._layout = null,
            this._token = 0;
            var t = this,
            n = this._$onupdate;
            this._$onupdate = function(e) {
                n.call(t, e)
            }
        };
        return o.prototype.updateConfig = function() {
            var e = this.width,
            t = this.height,
            n = Math.min(e, t),
            r = {
                center: this.center,
                width: this.ratioScaling ? e: n,
                height: this.ratioScaling ? t: n,
                scaling: this.scaling || 1,
                preventNodeOverlap: this.preventNodeOverlap,
                preventNodeEdgeOverlap: this.preventNodeEdgeOverlap,
                layerConstraint: this.layerConstraint,
                layerDistance: this.layerDistance,
                edgeLength: this.edgeLength
            };
            for (var i in r) this._layout[i] = r[i]
        },
        o.prototype.init = function(e) {
            this._layout || (this._layout = new t),
            this._isStable = !1,
            this.graph = e;
            var n = e.nodes.length;
            for (var r = 0; r < n; r++) {
                var i = e.nodes[r];
                i.layout.mass = i.layout.mass == null ? 1 : i.layout.mass,
                i.layout.size = i.layout.size == null ? 1 : i.layout.size,
                i.layout.layer = i.layout.layer == null ? 1 : i.layout.layer,
                i.layout.__index = r
            }
            n = e.edges.length;
            for (var r = 0; r < n; r++) {
                var o = e.edges[r];
                o.layout.node1Index = o.node1.layout.__index,
                o.layout.node2Index = o.node2.layout.__index,
                o.layout.weight = o.layout.weight || 1
            }
            this._token = s(),
            this._layout.setToken(this._token),
            this._layout.initNodes(e.nodes.map(function(e) {
                return e.layout
            })),
            this._layout.initEdges(e.edges.map(function(e) {
                return e.layout
            })),
            this.updateConfig()
        },
        o.prototype.step = function(e) {
            var t = this.graph.nodes;
            for (var n = 0; n < e; n++) this._layout.update();
            this._$onupdate()
        },
        o.prototype._$onupdate = function(e) {
            if (this._layout.tokenMatch(this._token)) {
                var t = 0,
                r = this._layout.nodes.length;
                for (var i = 0; i < this.graph.nodes.length; i++) {
                    var s = this.graph.nodes[i];
                    t += n.dist(s.layout.position, this._layout.nodes[i].position),
                    n.copy(s.layout.position, this._layout.nodes[i].position)
                }
                t < this.stableThreshold && (this._isStable = !0),
                this.onupdate && this.onupdate()
            }
        },
        o.prototype.isStable = function() {
            return this._isStable
        },
        o.prototype.dispose = function() {
            this._layout = null,
            this._token = 0
        },
        o
    }),
    r("bkgraph/entity/Entity", ["require", "zrender/mixin/Eventful", "zrender/tool/util", "zrender/Group"], function(e) {
        var t = e("zrender/mixin/Eventful"),
        n = e("zrender/tool/util"),
        r = e("zrender/Group"),
        i = function() {
            this.el = new r,
            t.call(this),
            this.states = {},
            this.defaultState = "",
            this.statesTransition = {},
            this._animations = {},
            this._shapes = {},
            this._currentState = this.defaultState
        };
        return i.prototype.hidden = !1,
        i.prototype.initialize = function(e) {
            this.zr = e;
            if (this.defaultState) {
                var t = this.states[this.defaultState];
                if (t) for (var r in this.states) {
                    var i = this.states[r];
                    i !== t && n.merge(i, t)
                }
            }
        },
        i.prototype.addShape = function(e, t) {
            this._shapes[e] = t,
            this.el.addChild(t)
        },
        i.prototype.getShape = function(e) {
            return this._shapes[e]
        },
        i.prototype.setState = function(e) {
            if (this._currentState === e) return;
            var t = this.states[this._currentState];
            if (this._currentState) {
                var r = this.statesTransition[this._currentState];
                if (!r || n.indexOf(r, e) < 0) return
            }
            var i = this.states[e];
            if (!i) return;
            if (i.shapeStyle) for (var s in i.shapeStyle) {
                var o = this._shapes[s];
                o && n.merge(o.style, i.shapeStyle[s], !0)
            }
            this._setAllShapeState(i, "zlevel"),
            this._setAllShapeState(i, "z"),
            this.zr.modElement(this.el),
            t && (t.onleave && t.onleave.call(this, t, i), this.dispatch("state:leave", t, i)),
            i.onenter && i.onenter.call(this, i, t),
            this.dispatch("state:enter", i, t),
            this._currentState = e
        },
        i.prototype.getState = function() {
            return this._currentState
        },
        i.prototype._setAllShapeState = function(e, t) {
            if (e[t] != null) for (var n in this._shapes) this._shapes[n][t] = e[t]
        },
        i.prototype.addAnimation = function(e, t) {
            this._animations[e] == null && (this._animations[e] = []),
            n.indexOf(this._animations[e], t) < 0 && this._animations[e].push(t);
            var r = this;
            return t.done(function() {
                var i = r._animations[e];
                i.splice(n.indexOf(t), 1)
            }),
            t
        },
        i.prototype.stopAnimation = function(e) {
            var t = this._animations[e];
            if (t) {
                for (var n = 0; n < t.length; n++) t[n].stop();
                this._animations[e] = null
            }
        },
        i.prototype.haveAnimation = function(e) {
            return this._animations[e] != null
        },
        i.prototype.stopAnimationAll = function() {
            for (var e in this._animations) this.stopAnimation(e);
            this._animations = {}
        },
        n.merge(i.prototype, t.prototype, !0),
        i
    }),
    r("bkgraph/shape/Crescent", ["require", "zrender/shape/Base", "zrender/tool/util"], function(e) {
        var t = e("zrender/shape/Base"),
        n = e("zrender/tool/util"),
        r = function(e) {
            t.call(this, e)
        };
        return r.prototype.type = "cresent",
        r.prototype.buildPath = function(e, t) {
            var n = t.r,
            r = t.x,
            i = t.y,
            s = Math.PI / 2,
            o = Math.acos((n - t.height) / n),
            u = s - o,
            a = s + o,
            f = r + Math.cos(u) * n,
            l = i + Math.sin(u) * n;
            e.moveTo(f, l),
            e.arc(r, i, n, u, a),
            e.closePath()
        },
        r.prototype.getRect = function(e) {
            var t = e.r,
            n = e.x,
            r = e.y,
            i = Math.PI / 2,
            s = Math.acos((t - e.height) / t),
            o = i - s,
            u = i + s,
            a = n + Math.cos(o) * t,
            f = r + Math.sin(o) * t,
            l = n + Math.cos(u) * t,
            c = r + Math.sin(u) * t;
            return {
                x: a,
                y: f,
                width: l - a,
                height: t - f
            }
        },
        n.inherits(r, t),
        r
    }),
    r("bkgraph/util/util", ["require", "zrender/tool/util"], function(e) {
        var t = document.createElement("canvas").getContext,
        n = e("zrender/tool/util"),
        r = {
            indexOf: function(e, t) {
                if (e.indexOf) return e.indexOf(t);
                for (var n = 0,
                r = e.length; n < r; n++) if (e[n] === t) return n;
                return - 1
            },
            bind: function(e, t) {
                return e.bind ? e.bind(t) : function() {
                    e.apply(t, arguments)
                }
            },
            _mouseFn: {},
            _mouseHandle: function(e) {
                var t = function(t) {
                    var n = t.target,
                    r = t.relatedTarget;
                    while (r && r != this) try {
                        r = r.parentNode
                    } catch(i) {
                        break
                    }
                    r != this && e.call(n, t)
                };
                return t
            },
            addEventListener: function(e, t, n, r) {
                if (window.addEventListener) {
                    if (e.onmouseenter !== undefined) {
                        e.addEventListener(t, n, r);
                        return
                    }
                    if (t == "mouseenter" || t == "mouseleave") {
                        var i = t == "mouseenter" ? "mouseover": "mouseout",
                        s = this._mouseHandle(n);
                        e.addEventListener(i, s, r),
                        this._mouseFn[e] || (this._mouseFn[e] = {}),
                        this._mouseFn[e][i] || (this._mouseFn[e][i] = {}),
                        this._mouseFn[e][i][n] = s
                    } else e.addEventListener(t, n, r)
                } else e.attachEvent("on" + t, n)
            },
            removeEventListener: function(e, t, n, r) {
                if (window.removeEventListener) {
                    if (e.onmouseenter !== undefined) {
                        e.removeEventListener(t, n, r);
                        return
                    }
                    if (t == "mouseenter" || t == "mouseleave") {
                        var i = t == "mouseenter" ? "mouseover": "mouseout";
                        if (!events._mouseFn[e][i][n]) return;
                        e.removeEventListener(i, events._mouseFn[e][i][n], r),
                        events._mouseFn[e][i][n] = null
                    } else e.removeEventListener(t, n, r)
                } else e.detachEvent("on" + t, n)
            },
            getStyle: function(e, t) {
                var n;
                return window.getComputedStyle ? n = window.getComputedStyle(e, null) : document.documentElement.currentStyle && (n = e.currentStyle),
                t ? n[t] : n
            },
            addClass: function(e, t) {
                e.classList ? e.classList.add(t) : e.className.indexOf(t) < 0 && (e.className += " " + t)
            },
            removeClass: function(e, t) {
                e.classList ? e.classList.remove(t) : e.className = e.className.replace(t, "")
            },
            hasClass: function(e, t) {
                return e.classList ? e.classList.contains(t) : e.className.indexOf(t) >= 0
            },
            debounce: function(e, t) {
                var n;
                return function() {
                    var r = this,
                    i = arguments,
                    s = navigator.userAgent.toLowerCase(),
                    o = /msie [\d.]+;/gi;
                    if (s.indexOf("msie") > 0 && (s.match(o) + "").replace(/[^0-9.]/ig, "") <= 8) e.apply(r, i);
                    else {
                        var u = function() {
                            n = null,
                            e.apply(r, i)
                        };
                        clearTimeout(n),
                        n = setTimeout(u, t)
                    }
                }
            },
            truncate: function(e, t, n) {
                return e.length > t ? (n = n == null ? "…": n, e.substring(0, t - n.length) + n) : e
            },
            trim: function(e) {
                return e.replace(/^\s+|\s+$/g, "")
            },
            supportCanvas: function() {
                return t
            },
            getURLSearch: function() {
                var e = window.location.search,
                t = {};
                if (e) {
                    e = e.slice(r.indexOf(e, "?") + 1);
                    var n = e.split("&");
                    for (var i = 0; i < n.length; i++) {
                        var s = n[i].split("="),
                        o = decodeURIComponent(s[0]),
                        u = decodeURIComponent(s[1]);
                        t[o] = u
                    }
                }
                return t
            }
        };
        return r
    }),
    r("bkgraph/config", {
        /*节点关系人物样式*/
        nodeStates: {
            normal: {
                shapeStyle: {
                    label: {
                        color: "#eab35d",
                        textColor: "#fff"
                    },
                    outline: {
                        lineWidth: 1,
                        strokeColor: "#e4e9f2"
                    },
                },
    			labelAlpha: 1
            },
            hover: {
                shapeStyle: {
                    label: {
                        color: "#eab35d"
                    },
                    outline: {
                        lineWidth: 2,
                        strokeColor: "#ff860d"
                    }
                }
            },
            active: {
                shapeStyle: {
                    label: {
                        color: "#eab35d"
                    },
                    outline: {
                        lineWidth: 2,
                        strokeColor: "#ff860d"
                    }
                }
            }
        },
        /*核心人物*/
        mainNodeStates: {
            normal: {
                shapeStyle: {
                    label: {
                        color: "#e86a51",//核心人物的背景颜色
                        textColor: "#fff"//核心人物的文字颜色
                    },
                    outline: {
                        lineWidth: 2,
                        strokeColor: "#c4c4bc"
                    },
                },
                labelAlpha: 1
            },
            hover: {
                shapeStyle: {
                    label: {
                        color: "#e86a51"
                    },
                    outline: {
                        strokeColor: "#ff860d"
                    }
                }
            },
            active: {
                shapeStyle: {
                    label: {
                        color: "#e86a51"
                    },
                    outline: {
                        strokeColor: "#ff860d"
                    }
                }
            }
        },
        //人物关系样式
        edgeStates: {
            normal: {
                shapeStyle: {
                    labelLine: {
                        color: "#333333",//关系圈的颜色
                        strokeColor: "#333333",
                        textColor: "#333333",
                        opacity: .5,
                        lineWidth: 1
                    }
                }
            },
            hover: {
                shapeStyle: {
                    labelLine: {
                        color: "#ff860d",
                        strokeColor: "#ff860d",
                        textColor: "#ff860d",
                        opacity: 1,
                        lineWidth: 1
                    }
                }
            },
            active: {
                shapeStyle: {
                    labelLine: {
                        color: "#ff860d",
                        strokeColor: "#ff860d",
                        textColor: "#ff860d",
                        opacity: 1,
                        lineWidth: 1
                    }
                }
            }
        },
        /*yyh tipInfo*/
        tip: {
            node: "双击头像，查看TA的详细资料吧~",
            nodeEnd: "显示已经到头了哦~"
        },
        enableAnimation: !!document.createElement("canvas").getContext,
        layout: {
            layerDistance: [0, 200, 300, 300, 300, 300, 300],
            layerConstraint: [100, 1, .3, .3, .2, .2, .1]
        },
        defaultNodeImage: "assets/images/userRelation/default-avatar.png",/*yyh*/
        isPlat: 0
    }),
    /*关键代码*/
    r("bkgraph/entity/Node", ["require", "./Entity", "zrender/Group", "zrender/shape/Circle", "zrender/shape/BezierCurve", "zrender/shape/Image", "../shape/Crescent", "zrender/tool/util", "zrender/tool/color", "zrender/tool/vector", "../util/util", "../config"],
    function(e) {
        var t = e("./Entity"),
        n = e("zrender/Group"),
        r = e("zrender/shape/Circle"),
        BezierCurveShape = e("zrender/shape/BezierCurve"),/*yyh*/
        i = e("zrender/shape/Image"),
        s = e("../shape/Crescent"),
        o = e("zrender/tool/util"),
        u = e("zrender/tool/color"),
        a = e("zrender/tool/vector"),
        b = e("zrender/mixin/Eventful"),
        f = e("../util/util"),
        l = e("../config"),
        c = 50;
        /*h = new Image;
        h.src = l.defaultNodeImage;*/
        var p = function(e) {
            t.call(this),
            e = e || {},
            this.radius = e.radius || 20,
            this.originalRadius = e.originalRadius || e.radius || 20,
            this.label = e.label || "",
            this.image = e.image || l.defaultNodeImage,
            this.expendNodeImage = e.expendNodeImage || "",
            this.markIcon = e.markIcon || "",
            this.markInfo = e.markInfo || "",
            this.personId = e.personId || "",
            this.weightType = e.weightType || 3,
            this.draggable = e.draggable || !1,
            this.states = {
                normal: {
                    name: "normal",
                    zlevel: 1,
                    z: 1,
                    labelAlpha: .6
                },
                /*删除hover active是可以改变人物的头像，（其实是覆盖了原来的头像）但是这样的话，人物的展开收缩事件会比较迟缓。此代码不能删除*/
                hover: {
                    name: "hover",
                    zlevel: 2,
                    onenter: function() {
                        this.animateRadius(this.originalRadius * 1.1, 500),
                        this.startActiveAnimation()
                    },
                    onleave: function(e, t) {
                        t.name !== "active" && (this.animateRadius(this.originalRadius, 500), this.stopActiveAnimation())
                    },
                    labelAlpha: .9
                },
                active: {
                    name: "active",
                    zlevel: 2,
                    onenter: function(e, t) {
                        t.name !== "hover" && (this.animateRadius(this.originalRadius * 1.1, 500), this.startActiveAnimation())
                    },
                    onleave: function(e, t) {
                        this.animateRadius(this.originalRadius, 500),
                        this.stopActiveAnimation()
                    },
                    labelAlpha: .9
                }
            },
            o.merge(this.states, e.states || {},!0),
            this.defaultState = e.defaultState != null ? e.defaultState: "normal",
            this.statesTransition = {
                normal: ["hover", "active"],
                hover: ["normal", "active"],
                active: ["normal"]
            },
            this._animatingCircles = []
        },
        d = ["mouseover", "mouseout", "click", "dblclick", "dragstart", "dragend", "dragenter", "dragover"];
        /*yyh画图*/
        p.prototype.initialize = function(e) {
            function l(e) {
                return function() {
                    n.dispatch(e)
                }
            }
            t.prototype.initialize.call(this, e);
            var n = this,
            o = this.radius,
            a = !1,
            //画圈
            f = new r({
                style: {
                    brushType: "stroke",
                    r: c,
                    x: 0,
                    y: 0
                },
                highlightStyle: {
                    opacity: 0
                },
                z: 3,
                zlevel: 1,
                clickable: !0,
                draggable: this.draggable,
                drift: function(e, t) {
                    n.el.position[0] += e,
                    n.el.position[1] += t
                }
            });
            for (var p = 0; p < d.length; p++) f["on" + d[p]] = l(d[p]);
            //画人物头像
            var h = new Image;
            h.src = this.image;
            var v = new i({
                style: {
                    image: h,
                    x: -c,
                    y: -c,
                    width: c * 2,
                    height: c * 2
                },
                z: 3,
                hoverable: !1,
                zlevel: 1
            });
            //画字
            if (this.label){
            	var m = new s({
                    style: {
                        height: 30,
                        x: 0,
                        y: 0,
                        r: c,
                        text: this.label,
                        textPosition: "inside",//附加文本位置,默认为top，线型默认为end。inside | left | right | top | bottom | start | end | specific，其中start end为线型（如line, polyline）特有
                        textAlign: "center",
                        brushType: "both",//绘画方式，默认为"fill"，fill(填充) | stroke(描边) | both(填充+描边)
                        textFont: "16px 宋体"
                    },
                    z: 3,
                    hoverable: !1,
                    zlevel: 1
                });
            }
            /*yyh-----画+ - start*/
            x = 16,
            y = new Image;
            y.src = this.expendNodeImage;
            /*yyh-----画+ - end*/
            //画展开收缩操作+ - 
            var handleIMg = new i({
            	style: {
	                image: y,
	                x: 45,
                    y: -10,
	                width: x,
	                height: x
            	},
            	z: 5,//z值，跟zlevel一样影响shape绘制的前后顺序，z值大的shape会覆盖在z值小的上面， 但是并不会创建新的canvas，所以优先级低于zlevel，而且频繁改动的开销比zlevel小很多。
                zlevel: 1,//z层level，决定绘画在哪层canvas中
                clickable : !0,   // default false
            });
            /*yyh-----画star - start*/
            markIconWidth = 18,
            markIconHeight = 17,
            markIcon = new Image;
            markIcon.src = this.markIcon;
            //var idd = this.personId;
            /*yyh-----画star - end*/
            var markIMg = new i({
            	style: {
	                image: markIcon,
	                x: 45,
                    y: -35,
	                width: markIconWidth,
	                height: markIconHeight
            	},
            	z: 5,//z值，跟zlevel一样影响shape绘制的前后顺序，z值大的shape会覆盖在z值小的上面， 但是并不会创建新的canvas，所以优先级低于zlevel，而且频繁改动的开销比zlevel小很多。
                zlevel: 1,//z层level，决定绘画在哪层canvas中
                clickable : !0,   // default false
                onclick : function(params){
            		var ev = params.event|| window.event;
    				function mouseCoords(ev){
    					if(ev.pageX || ev.pageY){ 
    						return {x:ev.pageX, y:ev.pageY}; 
    					} 
    					return{ 
    		        		x:ev.clientX + document.body.scrollLeft - document.body.clientLeft, 
    		        		y:ev.clientY + document.body.scrollTop - document.body.clientTop 
    					}; 
    				}
    				var mousePos = mouseCoords(ev);
    				$("#textarea")[0].value = n.markInfo;
    	        	$("#markInfo").css('left',mousePos.x+5);
    	    		$("#markInfo").css('top',mousePos.y-10);
    				$("#markInfo").css('display','block');
            	}
            });
            this.addShape("image",handleIMg),
            this.addShape("image",markIMg);
            this.addShape("image", v),	
            m && this.addShape("label", m),
            this.addShape("outline", f),
            this.el.scale[0] = this.el.scale[1] = this.radius / c,
            /*给字设置颜色yyh*/
            this.bind("state:enter",function(e) {
            	if(this.weightType==1||this.weightType==0){
            		m && (m.style.color = u.alpha(e.shapeStyle.label.color, e.labelAlpha))//alpha设置颜色的透明度
            	}else if(this.weightType==2){
            		m && (m.style.color = u.alpha("#9bb8e7", e.labelAlpha))//alpha设置颜色的透明度
            	}else if(this.weightType==3){
            		m && (m.style.color = u.alpha("#e8b088", e.labelAlpha))//alpha设置颜色的透明度
            	}
            }),
            this.defaultState && this.setState(this.defaultState)
        },
        p.prototype.drawBeline = function(e){
        	var beline = new BezierCurveShape({
			    /*style : {
			        xStart : e.layout.position[0],
			        yStart : e.layout.position[1],
			        cpX1 : e.layout.position[0]+50,
			        cpY1 : e.layout.position[1]/1.5,
			        xEnd : e.layout.position[0]+100,
			        yEnd : e.layout.position[1]+50,
			        strokeColor : '#ff860d',
			        lineWidth : 1
		    	},*/
		    	z: 1,//z值，跟zlevel一样影响shape绘制的前后顺序，z值大的shape会覆盖在z值小的上面， 但是并不会创建新的canvas，所以优先级低于zlevel，而且频繁改动的开销比zlevel小很多。
                zlevel: 1,//z层level，决定绘画在哪层canvas中
        	})
        	//this.addShape("bezier-curve", beline);
        	$("#markInfo").css('display','block');
    		$("#markInfo").css('left',e.layout.position[0]-120);
    		$("#markInfo").css('top',e.layout.position[1]-30);
        },
        /**
         * 添加修改备注
         */
        p.prototype.markModify = function(e,r){
        	var val = $("#textarea").val();
			if(val!=""){
				e.data.markIcon="assets/images/userRelation/markIcon.png";
				e.entity.markIcon = e.data.markIcon;
				e.data.markInfo=val;
				e.entity.markInfo = e.data.markInfo;
				/*e.entity._shapes.image.style.image.src="";//换人物头像
				e.data.image="assets/images/userRelation/hewen.png";
				e.entity.image = e.data.image;*/
				e.entity.initialize(r._zr);
				$("#markInfo").css('display','none');
			}else{
				alert("请输入要添加的备注信息！");
			}
        }
        /*加载有头像的图片*/
        p.prototype.loadImage = function(e, t, n) {
            if (this._imageLoaded) return;
            this._imageLoaded = !0;
            var r = this,
            i = new Image,
            s = this.image;
            i.crossOrigin = "anonymous",
            i.onload = function() {
                var n = r.getShape("image");
                n.style.image = i,
                n.modSelf(),
                e.refreshNextFrame(),
                t && t();
            },
            i.onerror = function() {
                n && n()
            },
            i.src = s;
        },
        p.prototype.setDraggable = function(e) {
            this.draggable = e,
            this.getShape("outline").draggable = e
        },
        p.prototype.setRadius = function(e) {
            this.radius = e,
            this.el.scale[0] = this.el.scale[1] = e / c,
            this.el.modSelf()
        },
        p.prototype.setZLevel = function(e) {
            this.getShape("outline").zlevel = e,
            this.getShape("image").zlevel = e,
            this.getShape("label").zlevel = e,
            this.el.modSelf()
        },
        p.prototype.animateRadius = function(e, t, n) {
            var r = this.zr;
            this.stopAnimation("radius");
            var i = this;
            this.addAnimation("radius", r.animation.animate(this).when(t || 1e3, {
                radius: e
            }).during(function() {
                i.setRadius(i.radius),
                r.refreshNextFrame()
            }).done(function() {
                n && n()
            })).start("ElasticOut")
        },
        p.prototype.startActiveAnimation = function() {
            var e = this.zr;
            if (this._animatingCircles.length) return;
            var t = Math.random() * Math.PI * 2;
            for (var n = 0; n < 3; n++) {
                var i = n / 3 * Math.PI * 2 + t,
                s = Math.cos(i) * 8,
                o = Math.sin(i) * 8,
                u = Math.cos(i + Math.PI) * 8,
                a = Math.sin(i + Math.PI) * 8,
                f = new r({
                    style: {
                        x: 0,
                        y: 0,
                        r: c,
                        color: this.states.hover.shapeStyle.outline.strokeColor,
                        opacity: .5
                    },
                    hoverable: !1,
                    zlevel: 2
                });
                this.addAnimation("glowcircle", e.animation.animate(f.style, {
                    loop: !0
                }).when(1e3, {
                    x: u,
                    y: a
                }).when(3e3, {
                    x: s,
                    y: o
                }).when(4e3, {
                    x: 0,
                    y: 0
                }).during(function() {
                    f.modSelf(),
                    e.refreshNextFrame()
                }).delay( - 500 * n).start()),
                this.el.addChild(f),
                this._animatingCircles.push(f)
            }
        },
        p.prototype.stopActiveAnimation = function() {
            var e = this.zr;
            if (this._animatingCircles.length) {
                for (var t = 0; t < this._animatingCircles.length; t++) {
                    var n = this._animatingCircles[t];
                    this.el.removeChild(n)
                }
                this._animatingCircles.length = 0,
                this.stopAnimation("glowcircle"),
                this.zr.refreshNextFrame()
            }
        };
        var v = [0, 0],
        m = [0, 0];
        return p.prototype.isInsideRect = function(e) {
            var t = this.radius;
            return v[0] = this.el.position[0] - t,
            v[1] = this.el.position[1] - t,
            m[0] = this.el.position[0] + t,
            m[1] = this.el.position[1] + t,
            !(v[0] > e.x + e.width || v[1] > e.y + e.height || m[0] < e.x || m[1] < e.y)
        },
        o.inherits(p, t),
        p
    }),
    r("bkgraph/shape/LabelLine", ["require", "zrender/shape/Base", "zrender/shape/Line", "zrender/tool/util", "zrender/tool/area"],
    function(e) {
        var t = e("zrender/shape/Base"),
        n = e("zrender/shape/Line"),
        r = e("zrender/tool/util"),
        i = e("zrender/tool/area"),
        s = function(e) {
            t.call(this, e)
        };
        return s.prototype.type = "labelline",
        s.prototype.brush = function(e, t) {
            var n = this.beforeBrush(e, t);
            e.beginPath(),
            e.moveTo(n.xStart, n.yStart),
            e.lineTo(n.xEnd, n.yEnd),
            e.stroke(),
            e.globalAlpha = 1;
            var r = n.cx,
            s = n.cy,
            o = n.r || 8;
            r == null && (r = (n.xStart + n.xEnd) / 2, s = (n.yStart + n.yEnd) / 2),
            e.beginPath(),
            e.arc(r, s, o, 0, Math.PI * 2),
            e.fill();
            var u = n.text,
            a = n.textPadding;
            a == null && (a = 5),
            e.font = n.textFont;
            var f = Math.atan2(n.yEnd - n.yStart, n.xEnd - n.xStart);
            f = Math.abs(f);
            var l = r,
            c = s,
            h = i.getTextWidth(u, n.textFont),
            p = i.getTextWidth("国", n.textFont);
            e.textBaseline = "top",
            f < .2 || f > 2.94 ? (c -= o + a + p, l -= h / 2, this.__rect = {
                x: Math.min(l, r - o * 2),
                y: c - p,
                width: Math.max(h, o * 2),
                height: p + a + o * 2
            }) : (l += o + a, c -= p / 2, this.__rect = {
                x: r - o * 2,
                y: s - Math.max(o * 2, p / 2),
                width: h + o * 4 + a,
                height: Math.max(p, o * 4)
            }),
            e.fillText(u, l, c),
            this.afterBrush()
        },
        s.prototype.getRect = function(e) {
            return this.__rect
        },
        s.prototype.isCover = function(e, t) {
            var n = this.transformCoordToLocal(e, t);
            e = n[0],
            t = n[1];
            var r = this.style,
            s = this.getRect(r);
            if (!s) return ! 1;
            var o = !1;
            return r.cpX1 ? o = i.isInsideQuadraticStroke(r.xStart, r.yStart, r.cpX1, r.cpY1, r.xEnd, r.yEnd, 20, e, t) : o = i.isInsideLine(r.xStart, r.yStart, r.xEnd, r.yEnd, 20, e, t),
            e >= s.x && e <= s.x + s.width && t >= s.y && t <= s.y + s.height || o
        },
        r.inherits(s, t),
        s
    }),
    r("bkgraph/shape/LabelCurve", ["require", "zrender/shape/Base", "zrender/shape/Line", "zrender/tool/util", "zrender/tool/curve", "zrender/tool/area", "./LabelLine"],
    function(e) {
        var t = e("zrender/shape/Base"),
        n = e("zrender/shape/Line"),
        r = e("zrender/tool/util"),
        i = e("zrender/tool/curve"),
        s = e("zrender/tool/area"),
        o = e("./LabelLine"),
        u = function(e) {
            t.call(this, e)
        };
        return u.prototype.type = "labelcurve",
        u.prototype.brush = function(e, t) {
            var n = this.beforeBrush(e, t),
            r = n.xStart || 0,
            o = n.yStart || 0,
            u = n.cpX1 || 0,
            a = n.cpY1 || 0,
            f = n.xEnd || 0,
            l = n.yEnd || 0;
            e.beginPath(),
            e.moveTo(r, o),
            e.quadraticCurveTo(u, a, f, l),
            e.stroke(),
            e.globalAlpha = 1;
            var c = n.cx,
            h = n.cy,
            p = n.r || 8;
            c == null && (c = i.quadraticAt(r, u, f, .5), h = i.quadraticAt(o, a, l, .5)),
            e.beginPath(),
            e.arc(c, h, p, 0, Math.PI * 2),
            e.fill();
            var d = n.text,
            v = n.textPadding;
            v == null && (v = 5),
            e.font = n.textFont;
            var m = s.getTextWidth(d, n.textFont),
            g = s.getTextWidth("国", n.textFont);
            e.textBaseline = "top";
            var y = c + p + v,
            b = h - g / 2;
            e.fillText(d, y, b),
            this.__rect = {
                x: c - p * 2,
                y: h - Math.max(p * 2, g / 2),
                width: m + p * 2 + v,
                height: Math.max(g, p * 2)
            },
            this.afterBrush(e)
        },
        u.prototype.getRect = o.prototype.getRect,
        u.prototype.isCover = o.prototype.isCover,
        r.inherits(u, t),
        u
    }),
    r("bkgraph/util/intersect", ["require", "zrender/tool/vector", "zrender/tool/curve"],
    function(e) {
        function u(e, t, n, r, i) {
            var s = (i - t) / (r - t);
            return s > 1 || s < 0 ? -Infinity: s * (n - e) + e
        }
        function a(e, t, n, r, i) {
            var s = (i - e) / (n - e);
            return s > 1 || s < 0 ? -Infinity: s * (r - t) + t
        }
        function l(e, t, r, i, s, o, u) {
            var a = n.quadraticRootAt(t, i, o, u, f);
            return a === 0 ? -Infinity: n.quadraticAt(e, r, s, f[0])
        }
        function c(e, t, r, i, s, o, u) {
            var a = n.quadraticRootAt(e, r, s, u, f);
            return a === 0 ? -Infinity: n.quadraticAt(t, i, o, f[0])
        }
        var t = e("zrender/tool/vector"),
        n = e("zrender/tool/curve"),
        r = 1e-4,
        i = t.create(),
        s = t.create(),
        o = t.create(),
        f = [],
        h = function(e, t, n) {
            var r = e.xStart,
            i = e.yStart,
            s = e.xEnd,
            o = e.yEnd,
            f = u(r, i, s, o, t.y),
            n = [];
            f >= t.x && f <= t.x + t.width && n.push({
                point: [f, t.y],
                side: "top"
            });
            var l = a(r, i, s, o, t.x);
            l >= t.y && l <= t.y + t.height && n.push({
                point: [t.x, l],
                side: "left"
            });
            var f = u(r, i, s, o, t.y + t.height);
            f >= t.x && f <= t.x + t.width && n.push({
                point: [f, t.y + t.height],
                side: "bottom"
            });
            var l = a(r, i, s, o, t.x + t.width);
            return l >= t.y && l <= t.y + t.height && n.push({
                point: [t.x + t.width, l],
                side: "right"
            }),
            n
        },
        p = function(e, t) {
            var n = e.xStart,
            r = e.yStart,
            i = e.cpX1,
            s = e.cpY1,
            o = e.xEnd,
            u = e.yEnd,
            a = l(n, r, i, s, o, u, t.y),
            f = [];
            a >= t.x && a <= t.x + t.width && f.push({
                point: [a, t.y],
                side: "top"
            });
            var h = c(n, r, i, s, o, u, t.x);
            h >= t.y && h <= t.y + t.height && f.push({
                point: [t.x, h],
                side: "left"
            });
            var a = l(n, r, i, s, o, u, t.y + t.height);
            a >= t.x && a <= t.x + t.width && f.push({
                point: [a, t.y + t.height],
                side: "bottom"
            });
            var h = c(n, r, i, s, o, u, t.x + t.width);
            return h >= t.y && h <= t.y + t.height && f.push({
                point: [t.x + t.width, h],
                side: "right"
            }),
            f
        },
        d = function(e, r, s) {
            var o = e.xStart,
            u = e.yStart,
            a = e.cpX1,
            f = e.cpY1,
            l = e.xEnd,
            c = e.yEnd,
            h = .1,
            p = Infinity,
            d, v = 0,
            m = 1;
            for (var g = 0; g < 3; g++) {
                for (var y = v; y < m; y += h) {
                    i[0] = n.quadraticAt(o, a, l, y),
                    i[1] = n.quadraticAt(u, f, c, y);
                    var b = Math.abs(t.dist(r, i) - s);
                    if (b < 1) break;
                    b < p && (p = b, d = y)
                }
                v = Math.max(d - h, 0),
                m = Math.min(d + h, 1),
                h /= 10
            }
            return [n.quadraticAt(o, a, l, d), n.quadraticAt(u, f, c, d)]
        };
        return {
            lineRect: h,
            curveRect: p,
            curveCircle: d
        }
    }),
    r("bkgraph/entity/CurveEdge", ["require", "./Entity", "zrender/shape/BezierCurve", "zrender/Group", "zrender/tool/util", "zrender/tool/curve", "../shape/LabelCurve", "zrender/shape/Circle", "../util/util", "../util/intersect", "../config", "zrender/tool/vector"],
    function(e) {
        function y(e, t, n) {
            return e * (1 - n) + t * n
        }
        var t = e("./Entity"),
        n = e("zrender/shape/BezierCurve"),
        r = e("zrender/Group"),
        i = e("zrender/tool/util"),
        s = e("zrender/tool/curve"),
        o = e("../shape/LabelCurve"),
        u = e("zrender/shape/Circle"),
        a = e("../util/util"),
        f = e("../util/intersect"),
        l = e("../config"),
        c = e("zrender/tool/vector"),
        h = c.create(),
        p = c.create(),
        d = c.create(),
        v = c.create(),
        m = c.create(),
        g = 8,
        b = function(e) {
            t.call(this),
            e = e || {},
            this.sourceEntity = e.sourceEntity || null,
            this.targetEntity = e.targetEntity || null,
            this.label = e.label || "",
            this.layerCounter = e.layerCounter || 1,
            //this.isExtra = e.isExtra,
            this.states = {
                normal: {
                    name: "normal",
                    zlevel: 1,
                    z: 0
                },
                hover: {
                    name: "hover",
                    zlevel: 3,
                    onenter: function(e, t) {
                        this.animateTextPadding(12, 300),
                        this.startActiveAnimation()
                    },
                    onleave: function(e, t) {
                        t.name !== "active" && (this.animateTextPadding(5, 300), this.stopActiveAnimation())
                    }
                },
                active: {
                    name: "active",
                    zlevel: 3,
                    onenter: function(e, t) {
                        t.name !== "hover" && (this.animateTextPadding(12, 300), this.startActiveAnimation())
                    },
                    onleave: function(e, t) {
                        this.animateTextPadding(5, 300),
                        this.stopActiveAnimation()
                    }
                }
            },
            i.merge(this.states, e.states || {}),
            this.defaultState = e.defaultState == null ? "normal": e.defaultState,
            this.statesTransition = {
                normal: ["hover", "active"],
                hover: ["normal", "active"],
                active: ["normal"]
            },
            this._animatingCircles = []
        };
        return b.prototype.initialize = function(e) {
            t.prototype.initialize.call(this, e);
            var n = this,
            r = new o({
                style: {
                    r: 8,
                    text: a.truncate(this.label, 10),
                    textFont: "14px 宋体",
                    textPadding: 5,
                    dropletPadding: 0
                },
                clickable: !0,
                onclick: function() {
                    n.dispatch("click")
                },
                onmouseover: function() {
                    n.dispatch("mouseover")
                },
                onmouseout: function() {
                    n.dispatch("mouseout")
                }
            });
            this.addShape("labelLine", r),
            this.update(),
            this.defaultState && this.setState(this.defaultState)
        },
        b.prototype.update = function() {
            this.sourceEntity && this.targetEntity && this._computeCurvePoints(this.sourceEntity.el.position, this.targetEntity.el.position, 1, !0),
            this.el.modSelf()
        },
        b.prototype.animateLength = function(e, t, n, r, i) {
            var s = this.getShape("labelLine"),
            o = s.style,
            u,
            a,
            f,
            l,
            c = o.cpX1,
            h = o.cpY1,
            p = r === this.sourceEntity;
            if (p) var u = o.xStart,
            f = o.xEnd,
            a = o.yStart,
            l = o.yEnd;
            else var u = o.xEnd,
            f = o.xStart,
            a = o.yEnd,
            l = o.yStart;
            var d = this,
            v = {
                t: 0
            };
            this.addAnimation("length", e.animation.animate(v).when(t || 1e3, {
                t: 1
            }).during(function(t, n) {
                var r = y(u, c, n),
                i = y(c, f, n),
                s = y(r, i, n),
                v = y(a, h, n),
                m = y(h, l, n),
                g = y(v, m, n);
                o.cpX1 = r,
                o.cpY1 = v,
                p ? (o.xEnd = s, o.yEnd = g) : (o.xStart = s, o.yStart = g),
                d.el.modSelf(),
                e.refreshNextFrame()
            }).delay(n).done(function() {
                i && i()
            }).start())
        },
        b.prototype.animateTextPadding = function(e, t, n) {
            var r = this,
            i = this.zr;
            this.stopAnimation("textPadding"),
            this.addAnimation("textPadding", i.animation.animate(this.getShape("labelLine").style)).when(t, {
                textPadding: e
            }).during(function() {
                r.el.modSelf(),
                i.refreshNextFrame()
            }).done(n).start("ElasticOut")
        },
        b.prototype.startActiveAnimation = function(e) {
            if (this._animatingCircles.length) return;
            var t = this.zr,
            n = this.getShape("labelLine");
            for (var r = 3; r > 0; r--) {
                var i = new u({
                    style: {
                        x: n.style.cx,
                        y: n.style.cy,
                        r: g,
                        color: this.states.hover.shapeStyle.labelLine.strokeColor,
                        opacity: this.states.hover.shapeStyle.labelLine.opacity * .8
                    },
                    hoverable: !1,
                    zlevel: 3
                });
                this.addAnimation("ripplecircle", t.animation.animate(i.style, {
                    loop: !0
                }).when(3e3, {
                    r: g + 12,
                    opacity: 0
                }).during(function() {
                    i.modSelf(),
                    t.refreshNextFrame()
                }).delay( - 1e3 * r).start("Linear")),
                this.el.addChild(i),
                this._animatingCircles.push(i)
            }
        },
        b.prototype.stopActiveAnimation = function(e) {
            if (this._animatingCircles.length) {
                for (var t = 0; t < this._animatingCircles.length; t++) {
                    var n = this._animatingCircles[t];
                    this.el.removeChild(n)
                }
                this._animatingCircles.length = 0,
                this.stopAnimation("ripplecircle"),
                this.zr.refreshNextFrame()
            }
        },
        b.prototype._computeCurvePoints = function(e, t) {
            var n = this.sourceEntity,
            r = this.targetEntity,
            i = this.getShape("labelLine");
            this._setCurvePoints(i, e, t),
            e = f.curveCircle(i.style, e, n.originalRadius),
            t = f.curveCircle(i.style, t, r.originalRadius),
            this._setCurvePoints(i, e, t),
            i.style.cx = s.quadraticAt(i.style.xStart, i.style.cpX1, i.style.xEnd, .5),
            i.style.cy = s.quadraticAt(i.style.yStart, i.style.cpY1, i.style.yEnd, .5)
        },
        b.prototype._setCurvePoints = function(e, t, n) {
            e.style.xStart = t[0],
            e.style.yStart = t[1],
            e.style.xEnd = n[0],
            e.style.yEnd = n[1];
            var r = 1;
            /*if(this.isExtra){
            	r = 1.3
            }*/
            r *= this.layerCounter % 2 == 0 ? 1 : -1,
            e.style.cpX1 = (t[0] + n[0]) / 2 - r * (t[1] - n[1]) / 4,
            e.style.cpY1 = (t[1] + n[1]) / 2 - r * (n[0] - t[0]) / 4
        },
        b.prototype.intersectRect = function(e) {
            return f.curveRect(this.getShape("labelLine").style, e)
        },
        b.prototype.isInsideRect = function(e) {
            var t = this.getShape("labelLine").style;
            return c.set(p, t.cpX1, t.cpY1),
            c.set(d, t.xEnd, t.yEnd),
            c.set(v, t.xStart, t.yStart),
            c.set(m, t.xStart, t.yStart),
            c.min(v, v, p),
            c.min(v, v, d),
            c.max(m, m, p),
            c.max(m, m, d),
            !(m[0] < e.x || m[1] < e.y || v[0] > e.x + e.width || v[1] > e.y + e.height)
        },
        i.inherits(b, t),
        b
    }),
    r("bkgraph/entity/OutTip", ["require", "./Entity", "zrender/tool/util", "zrender/shape/Rectangle"],
    function(e) {
        var t = e("./Entity"),
        n = e("zrender/tool/util"),
        r = e("zrender/shape/Rectangle"),
        i = function(e) {
            t.call(this),
            this.label = e.label || "",
            this.color = e.color || "#85b6ff",
            this.el = new r({
                style: {
                    x: -25,
                    y: 0,
                    width: 55,
                    height: 25,
                    radius: 5,
                    textPosition: "inside",
                    textColor: "white",
                    textFont: "12px 微软雅黑",
                    opacity: .9
                },
                highlightStyle: {
                    opacity: 0
                },
                hoverable: !1,
                zlevel: 3,
                z: 100
            })
        };
        return i.prototype.initialize = function(e) {
            this.el.style.color = this.color,
            this.el.style.text = this.label
        },
        n.inherits(i, t),
        i
    }),
    r("bkgraph/shape/CurveBundle", ["require", "zrender/shape/Base", "zrender/tool/util"],
    function(e) {
        var t = e("zrender/shape/Base"),
        n = e("zrender/tool/util"),
        r = function(e) {
            t.call(this, e)
        };
        return r.prototype = {
            type: "curvebundle",
            brushTypeOnly: "stroke",
            buildPath: function(e, t) {
                for (var n = 0; n < t.segments.length; n++) {
                    var r = t.segments[n];
                    e.moveTo(r[0], r[1]),
                    e.quadraticCurveTo(r[2], r[3], r[4], r[5])
                }
            }
        },
        n.inherits(r, t),
        r
    }),
    r("bkgraph/entity/ExtraEdgeBundle", ["require", "./Entity", "zrender/tool/curve", "zrender/tool/util", "../shape/CurveBundle", "../config", "../util/intersect", "zrender/tool/vector"],
    function(e) {
        var t = e("./Entity"),
        n = e("zrender/tool/curve"),
        r = e("zrender/tool/util"),
        i = e("../shape/CurveBundle"),
        s = e("../config"),
        o = e("../util/intersect"),
        u = e("zrender/tool/vector"),
        a = function(e) {
            e = e || {},
            t.call(this),
            this.el = new i({
                style: {
                    segments: []
                },
                hoverable: !1
            }),
            this.edges = []
        };
        return a.prototype.initialize = function(e) {
            //var t = s.extraEdgeStates.normal.shapeStyle.labelLine;
            this.el.style.strokeColor = t.strokeColor,
            this.el.style.opacity = t.opacity,
            this.el.style.lineWidth = t.lineWidth,
            this.update(e)
        },
        a.prototype.update = function(e) {
            var t = 0;
            for (var n = 0; n < this.edges.length; n++) {
                var r = this.edges[n],
                i = r.node1.entity,
                s = r.node2.entity,
                o = Math.max(r.node1.data.layerCounter, r.node2.data.layerCounter),
                u = this.el.style.segments,
                a = u[n];
                a || (a = u[n] = []),
                i && s && (this._calCurvePoints(i, s, o, a), t++)
            }
            this.el.style.segments.length = t,
            this.el.modSelf()
        },
        a.prototype.addEdge = function(e) {
            var t = e.node1.entity,
            n = e.node2.entity,
            r = Math.max(e.node1.data.layerCounter, e.node2.data.layerCounter),
            i = [];
            t && n && (this._calCurvePoints(t, n, r, i), this.edges.push(e), this.el.style.segments.push(i), this.el.modSelf())
        },
        a.prototype.removeEdge = function(e) {
            var t = this.edges.indexOf(e);
            t > 0 && (this.edges.splice(t, 1), this.el.style.segments.splice(t, 1))
        },
        a.prototype._calCurvePoints = function(e, t, n, r) {
            var i = 1.3,
            s = this.el,
            u = e.el.position,
            a = t.el.position,
            f = {
                xStart: u[0],
                yStart: u[1],
                xEnd: a[0],
                yEnd: a[1]
            };
            i *= n % 2 == 0 ? 1 : -1,
            f.cpX1 = (u[0] + a[0]) / 2 - i * (u[1] - a[1]) / 4,
            f.cpY1 = (u[1] + a[1]) / 2 - i * (a[0] - u[0]) / 4,
            u = o.curveCircle(f, u, e.originalRadius),
            a = o.curveCircle(f, a, t.originalRadius),
            r[0] = u[0],
            r[1] = u[1],
            r[2] = (u[0] + a[0]) / 2 - i * (u[1] - a[1]) / 4,
            r[3] = (u[1] + a[1]) / 2 - i * (a[0] - u[0]) / 4,
            r[4] = a[0],
            r[5] = a[1]
        },
        r.inherits(a, t),
        a
    }),
    r("bkgraph/util/Parallax", ["require"], function(e) {
        function t(e) {
            typeof e == "string" && (e = document.getElementById(e));
            var t = e.firstChild,
            n = [];
            while (t) t.className && t.className.indexOf("bkg-bg-layer") >= 0 && n.push(t),
            t = t.nextSibling;
            for (var r = 0; r < n.length; r++) {
                var i = n[r];
                i._offsetX = i.clientWidth - e.clientWidth,
                i._offsetY = i.clientWidth - e.clientWidth
            }
            this._root = e,
            this._bgLayers = n,
            this._offsetX = 0,
            this._offsetY = 0
        }
        return t.prototype.scaleBase = .5,
        t.prototype.scaleStep = .5,
        t.prototype.setOffset = function(e, t) {
            this._offsetX = -e,
            this._offsetY = -t,
            this.moveTo(0, 0)
        },
        t.prototype.moveTo = function(e, t) {
            var n = this.scaleBase;
            for (var r = 0; r < this._bgLayers.length; r++) {
                var i = this._bgLayers[r],
                s = e * n + this._offsetX,
                o = t * n + this._offsetY;
                n *= this.scaleStep,
                s = -Math.max(Math.min( - s, i._offsetX), 0),
                o = -Math.max(Math.min( - o, i._offsetY), 0);
                var u = "translate3d(" + Math.round(s) + "px," + Math.round(o) + "px, 0px)";
                i.style.WebkitTransform = u,
                i.style.MozTransform = u,
                i.style.transform = u
            }
        },
        t
    }),
    r("bkgraph/util/cookies", ["require"], function(e) {
        var t = function(e, n, r) {
            return arguments.length === 1 ? t.get(e) : t.set(e, n, r)
        };
        return t._document = document,
        t._navigator = navigator,
        t.defaults = {
            path: "/"
        },
        t.get = function(e) {
            return t._cachedDocumentCookie !== t._document.cookie && t._renewCache(),
            t._cache[e]
        },
        t.set = function(e, n, r) {
            return r = t._getExtendedOptions(r),
            r.expires = t._getExpiresDate(n === undefined ? -1 : r.expires),
            t._document.cookie = t._generateCookieString(e, n, r),
            t
        },
        t.expire = function(e, n) {
            return t.set(e, undefined, n)
        },
        t._getExtendedOptions = function(e) {
            return {
                path: e && e.path || t.defaults.path,
                domain: e && e.domain || t.defaults.domain,
                expires: e && e.expires || t.defaults.expires,
                secure: e && e.secure !== undefined ? e.secure: t.defaults.secure
            }
        },
        t._isValidDate = function(e) {
            return Object.prototype.toString.call(e) === "[object Date]" && !isNaN(e.getTime())
        },
        t._getExpiresDate = function(e, n) {
            n = n || new Date;
            switch (typeof e) {
            case "number":
                e = new Date(n.getTime() + e * 1e3);
                break;
            case "string":
                e = new Date(e)
            }
            if (e && !t._isValidDate(e)) throw new Error("`expires` parameter cannot be converted to a valid Date instance");
            return e
        },
        t._generateCookieString = function(e, t, n) {
            e = e.replace(/[^#$&+\^`|]/g, encodeURIComponent),
            e = e.replace(/\(/g, "%28").replace(/\)/g, "%29"),
            t = (t + "").replace(/[^!#$&-+\--:<-\[\]-~]/g, encodeURIComponent),
            n = n || {};
            var r = e + "=" + t;
            return r += n.path ? ";path=" + n.path: "",
            r += n.domain ? ";domain=" + n.domain: "",
            r += n.expires ? ";expires=" + n.expires.toUTCString() : "",
            r += n.secure ? ";secure": "",
            r
        },
        t._getCookieObjectFromString = function(e) {
            var n = {},
            r = e ? e.split("; ") : [];
            for (var i = 0; i < r.length; i++) {
                var s = t._getKeyValuePairFromCookieString(r[i]);
                n[s.key] === undefined && (n[s.key] = s.value)
            }
            return n
        },
        t._getKeyValuePairFromCookieString = function(e) {
            var t = e.indexOf("=");
            return t = t < 0 ? e.length: t,
            {
                key: decodeURIComponent(e.substr(0, t)),
                value: decodeURIComponent(e.substr(t + 1))
            }
        },
        t._renewCache = function() {
            t._cache = t._getCookieObjectFromString(t._document.cookie),
            t._cachedDocumentCookie = t._document.cookie
        },
        t._areEnabled = function() {
            var e = "cookies.js",
            n = t.set(e, 1).get(e) === "1";
            return t.expire(e),
            n
        },
        t.enabled = t._areEnabled(),
        t
    }),
    r("bkgraph/util/log", ["require", "./cookies", "../config", "zrender/tool/util"], function(e) {
        var t = e("./cookies"),
        n = e("../config"),
        r = e("zrender/tool/util"),
        i = 0;
        return function(e) {
            if (n.isPlat) return;
            //var t = "assets/images/userRelation/default-avatar.png",
            s = (new Date).getTime(),
            o = {
                path: document.location.href,
                referrer: document.referrer
            };
            e.extend = (e.extend || "") + ".t_" + (new Date).getTime() + "_" + i++,
            e = r.merge(e, o);
            for (var u in e) e.hasOwnProperty(u) && (t += "&" + u + "=" + encodeURIComponent(e[u]));
            var a = window["BD_PS_C" + s] = new Image;
            //a.src = t
        }
    }),
    r("bkgraph/component/Cycle", ["require", "../util/util"], function(e) {
        var t = e("../util/util"),
        n = function() {
            this.nodes = [],
            this.edges = []
        };
        return n.findFromGraph = function(e, r) {
            var i = [],
            s = [],
            o = function(u, a, f) {
                if (f + 1 > r) return;
                i.push(u);
                for (var l = 0; l < u.edges.length; l++) {
                    var c = u.edges[l],
                    h = c.node1 === u ? c.node2: c.node1;
                    if (t.indexOf(i, h) >= 0) {
                        if (h === a && i.length > 2 && i.length <= r) {
                            var p = new n;
                            p.nodes = i.slice(),
                            s.push(p);
                            var d = p.nodes.length;
                            for (var v = 0; v < d; v++) {
                                var m = p.nodes[v],
                                g = p.nodes[(v + 1) % d],
                                c = e.getEdge(m, g) || e.getEdge(g, m);
                                p.edges.push(c)
                            }
                        }
                    } else o(h, a, f + 1)
                }
                i.pop()
            };
            for (var u = 0; u < e.nodes.length; u++) i = [],
            o(e.nodes[u], e.nodes[u], 0);
            return s
        },
        n
    }),
    /*yyh 关键代码*/
    r("bkgraph/component/GraphMain", ["require", "zrender", "echarts/data/Graph", "echarts/data/Tree", "echarts/layout/Tree", "zrender/tool/util", "zrender/Group", "zrender/shape/Circle", "./Component", "zrender/tool/vector", "../layout/ForceLayout", "../entity/Node", "../entity/CurveEdge", "../entity/OutTip", "../entity/ExtraEdgeBundle", "../util/Parallax", "../util/log", "../util/util", "../util/intersect", "../util/cookies", "./Cycle", "../config"],
    function(e) {
        function N(e) {
            return e > x || e < -x
        }
        function k(e, t, n) {
            var r = f.create(),
            i = Math.random() * Math.PI * 2;
            return r[0] = Math.cos(i) * n + e,
            r[1] = Math.sin(i) * n + t,
            r
        }
        var t = e("zrender"),
        nn = e("echarts/data/Graph"),
        r = e("echarts/data/Tree"),
        i = e("echarts/layout/Tree"),
        s = e("zrender/tool/util"),
        o = e("zrender/Group"),
        u = e("zrender/shape/Circle"),
        a = e("./Component"),
        f = e("zrender/tool/vector"),
        l = e("../layout/ForceLayout"),
        c = e("../entity/Node"),
        h = e("../entity/CurveEdge"),
        p = e("../entity/OutTip"),
        d = e("../entity/ExtraEdgeBundle"),
        v = e("../util/Parallax"),
        m = e("../util/log"),
        g = e("../util/util"),
        y = e("../util/intersect"),
        w = e("../util/cookies"),
        E = e("./Cycle"),
        S = e("../config"),
        x = .01,
        T = function(e) {
            return e > -x && e < x
        },
        C = function() {
            a.call(this),
            this.minRadius = 30,
            this.maxRadius = 40,
            this.draggable = !0,//人物是否可拖拽
            this.enableEntryAnimation = !0,
            this._kgraph = null,
            this._zr = null,
            this._graph = null,
            this._graphLayout = null,
            this._layouting = !1,
            this._animating = !1,
            this._root = null,
            this._mainNode = null,
            this._lastHoverNode = null,
            this._lastHoverEdge = null,
            this._currentActiveNode = null,
            this._nodeEntityCount = 0,
            this._baseEntityCount = 0,
            //this._defaultLayerCount = 1,
            this._parallax = null,
            this._isFirstFrame = !0
        };
        var yyht;/*必须是全局变量*/
        return C.prototype.type = "GRAPH",
        C.prototype.initialize = function(e) {
            this._kgraph = e;
            var t = this.el;
            this.el.className = "bkg-graph",
            t.style.width = e.getWidth() + "px",
            t.style.height = e.getHeight() + "px",
            this._initBG(),
            this._initZR();
            var n = this;
            g.addEventListener(t, "mousedown",
            function() {
                n._mouseDown = !0,
                n.hideTip()
            }),
            g.addEventListener(t, "mouseup",
            function() {
                n._mouseDown = !1
            })
        },
        C.prototype.enableDrag = function() {
            this.draggable = !0,
            this._graph.eachNode(function(e) {
                e.entity && e.entity.setDraggable(!0)
            })
        },
        C.prototype.disableDrag = function() {
            this.draggable = !1,
            this._graph.eachNode(function(e) {
                e.entity && e.entity.setDraggable(!1)
            })
        },
        C.prototype.refresh = function() {
            this._zr.refreshNextFrame()
        },
        C.prototype.getGraph = function() {
            return this._graph
        },
        C.prototype.getZR = function() {
            return this._zr
        },
        C.prototype.getMainNode = function() {
            return this._graph.getNodeById(this._mainNode.id)
        },
        C.prototype.getCircles = function() {
            return this._circles
        },
        C.prototype._initZR = function() {
            $zrContainer = document.createElement("div"),
            $zrContainer.className = "bkg-graph-zr",
            this.el.appendChild($zrContainer),
            this._zr = t.init($zrContainer);
            var e = this._zr.painter.refresh,
            n = this,
            r = this._zr;
            this._min = [Infinity, Infinity],
            this._max = [r.getWidth() / 2, r.getHeight() / 2];
            var i = 0,
            s = 0,
            o = 0,
            u = 0,
            a = (new Date).getTime();
            r.painter.refresh = function() {
                var t = r.painter.getLayers(),
                l = t[0];
                if (l) {
                    var c = l.position,
                    h = l.scale;
                    c[0] = Math.max( - n._max[0] * h[0] + r.getWidth() - 500, c[0]),
                    c[1] = Math.max( - n._max[1] * h[1] + r.getHeight() - 300, c[1]),
                    c[0] = Math.min( - n._min[0] * h[0] + 500, c[0]),
                    c[1] = Math.min( - n._min[1] * h[1] + 300, c[1]);
                    var p = N(c[0] - i) || N(c[1] - s),
                    d = N(h[0] - o) || N(h[1] - u);
                    for (var v in t) if (v !== "hover") {
                        if (N(c[0] - t[v].position[0]) || N(c[1] - t[v].position[1]) || N(h[0] - t[v].scale[0]) || N(h[1] - t[v].scale[1])) t[v].dirty = !0;
                        f.copy(t[v].position, c),
                        f.copy(t[v].scale, h)
                    }
                    if (p || d) {
                        for (var v in t) v !== "hover" && (t[v].dirty = !0);
                        n._syncOutTipEntities();
                        if (p) {
                            var g = (new Date).getTime();
                            g - a >= 2e3 && n._mouseDown && (m({
                                type: "zhishitupupan",
                                target: c[0] + "," + c[1]
                            }), a = g)
                        }
                        if (d) {
                            var g = (new Date).getTime();
                            g - a >= 2e3 && (m({
                                type: "zhishitupuzoom",
                                target: h[0]
                            }), a = g)
                        }
                    }
                    i = c[0],
                    s = c[1],
                    o = h[0],
                    u = h[1],
                    n._parallax && n._parallax.moveTo(i / o, s / u)
                }
                n._culling(),
                e.apply(this, arguments)
            };
            var l = r.painter.getLayers();
            for (var c in l) c === "hover" && l[c].dom.parentNode.removeChild(l[c].dom)
        },
        C.prototype._initBG = function() {
            var e = document.createElement("div");
            e.className = "bkg-graph-bg",
            this.el.appendChild(e),
            e.innerHTML = '<div class="bkg-bg-layer"></div>'
            this._parallax = new v(e),
            this._parallax.scaleBase = .4,
            this._parallax.scaleStep = .5,
            this._parallax.setOffset(2e3, 2e3)
        },
        C.prototype.resize = function(e, t) {
            this.el.style.width = e + "px",
            this.el.style.height = t + "px",
            this._zr.resize(),
            this._syncOutTipEntities()
        },
        /**
         * e为传过来的数据值（从数据库获取的当前点击的人物的下级数据）   
         * ree为当前点击的那个人的信息
         * */
        C.prototype.setData = function(e,ree) {
        	if(ree==""){
        		yyht = new nn(!0);
                this._graphLayout = yyht;
                var r = this._zr,
                i = this._kgraph.getWidth() / 2,
                s = this._kgraph.getHeight() / 2,
                o = r.getWidth(),
                u = r.getHeight(),
                a = -Infinity,
                f = Infinity;//无穷大
                /*for (var l = 0; l < e.entities.length; l++) {
                    var c = e.entities[l];
                    f = Math.min(f, c.hotValue),//返回最小的那个数字
                    a = Math.max(a, c.hotValue)//返回最大的那个数字
                }*/
                var h = a - f,
                p = !1;
                /*循环人物节点*/
                for (var l = 0; l < e.entities.length; l++) {
                    var c = e.entities[l],
                    d = yyht.addNode(c.id, c);
                    v = 45;
                    //v = h > 0 ? (c.hotValue - f) * (this.maxRadius - this.minRadius) / h + this.minRadius : (this.maxRadius + this.minRadius) / 2;
                    if(c.layerCounter === 0) {
                    	v = 65, /*设置画人物头像以及圆圈的大小*/
                    	this._mainNode = d
                    }
                    d.layout = {
                        position: c.position,
                        size: v
                    },
                    c.layerCounter === 0 && (d.layout.fixed = !0);
                    if(!c.position){
                    	p = !0; 
                    	if(c.layerCounter === 0){
                    		d.layout.position = [o / 2, u / 2], 
                    		d.position = Array.prototype.slice.call(d.layout.position)
                    	}
                    }
                }
                /*循环连接关系*/
                for (var l = 0; l < e.relations.length; l++) {
                    var y = e.relations[l];
                    yyht.addEdge(y.fromID, y.toID, y);
                }
                
                /*this._graph = this._graphLayout.clone(),*/
                this._graph = this._graphLayout,/*关键代码*/
                this._graph.eachNode(function(e) {
                    e.layout = this._graphLayout.getNodeById(e.id).layout
                },this);
                
                if (p){
                	this.radialTreeLayout();
                } else {
                    var w = o / 2 - this._mainNode.layout.position[0],
                    E = u / 2 - this._mainNode.layout.position[1];
                    this._graph.eachNode(function(e) {
                        e.layout.position[0] += w,
                        e.layout.position[1] += E
                    })
                }
                
                this.render(),
                this._loadStorage();
                var SS = [];
                this._graph.eachNode(function(e) {
                    e.entity && SS.push(e.id, parseInt(e.data.layerCounter))
                });
                var x = 200,
                T = Math.ceil(SS.length / x),
                N = [],
                C = g.getURLSearch();
                for (var k = 0; k < T; k++) {
                    N = [];
                    var L = (k + 1) * x > SS.length ? SS.length: (k + 1) * x;
                    for (var A = k * x; A < L; A++) N.push(SS[A]);
                    m({
                        type: "zhishitupuse",
                        target: N.join(","),
                        page: T + "-" + (k + 1),
                        extend: C.srcid ? C.srcid: ""
                    })
                }
        	}else{
        		/*循环人物节点*/
                for (var l = 0; l < e.entities.length; l++) {
                    var c = e.entities[l],
                    d = yyht.addNode(c.id, c);
                    v = 45;
                    //v = h > 0 ? (c.hotValue - f) * (this.maxRadius - this.minRadius) / h + this.minRadius : (this.maxRadius + this.minRadius) / 2;
                    if(c.layerCounter === 0) {
                    	v = 65, /*设置画人物头像以及圆圈的大小*/
                    	this._mainNode = d
                    }
                    d.layout = {
                        position: c.position,
                        size: v
                    };
                    if(!c.position){
                    	p = !0; 
                    	if(c.layerCounter === 0){
                    		d.layout.position = [o / 2, u / 2], 
                    		d.position = Array.prototype.slice.call(d.layout.position)
                    	}
                    }
                }
                /*循环连接关系*/
                for (var l = 0; l < e.relations.length; l++) {
                    var y = e.relations[l];
                    yyht.addEdge(y.fromID, y.toID, y);
                }
                
                this.radialTreeLayout();
                if(typeof ree == "string"){
            		ree = this._graph.getNodeById(ree)
            	}
                var t = this._zr;
                if (!ree || !ree.entity) return;
                this.unactiveAll(),
                ree.entity.setState("active"),
                this._currentActiveNode = ree;
                for (var n = 0; n < ree.edges.length; n++) {
                    var r = ree.edges[n],
                    i = r.node1 === ree ? r.node2: r.node1;
                    var s = !1,   //!1false
                    o = !1;
                    if(!i.entity){
                    	this._createNodeEntity(i), 
                    	s = !0
                    }
                    if(!r.entity){
                    	this._createEdgeEntity(r),
                    	o = !0
                    }
                    if(S.enableAnimation){
                    	if(s){
                    		this._growNodeAnimation(i, ree, Math.random() * 500)
                    	}else{
                    		if(o){
                    			r.entity.animateLength(t, 300, 0, ree.entity)
                    		}
                    	}
                    }
                    //this._syncOutTipEntities()
                }
                //this._syncHeaderBarExplorePercent(),
                t.refreshNextFrame()
        	}
        },
        C.prototype.render = function() {
            var e = this._zr,
            t = this._graph;
            this._root && e.delGroup(this._root),
            this._root = new o,
            e.addGroup(this._root),
            S.enableAnimation && (this._extraEdgeBundle = new d, this._extraEdgeBundle.initialize(e), this._root.addChild(this._extraEdgeBundle.el));
            /*判断当人物只有一个，没有人物关系的时候只画一个人物的Bug yyh*/
            if(t.edges.length==0){
            	for(var i=0;i<t.nodes.length;i++){
            		if(!t.nodes[i].entity){
            			this._createNodeEntity(t.nodes[i]);
            		}
            	}
            }
            t.eachEdge(function(e) {
            	/*yyh*/
            	/*if(e.node1.data.layerCounter <= this._defaultLayerCount && e.node2.data.layerCounter <= this._defaultLayerCount){*/
            		if(!e.node1.entity){
        				this._baseEntityCount++, 
        				this._createNodeEntity(e.node1);
        			}
        			if(!e.node2.entity){
        				this._baseEntityCount++, 
        				this._createNodeEntity(e.node2);
        			}
        			if(!e.entity){
        				this._createEdgeEntity(e);
        			}
            	/*};*/
            },this);
            e.refreshNextFrame(),
            e.modLayer(0, {
                panable: !0,
                zoomable: !0,
                maxZoom: 1.5,
                minZoom: .6
            })
        },
        C.prototype.radialTreeLayout = function() {
            var e = this._zr.getWidth() / 2,
            t = this._zr.getHeight() / 2,
            n = r.fromGraph(this._graphLayout)[0],
            s = n.root;
            if (s.children.length > 2) {
                for (var o = 0; o < s.children.length; o++) {
                    var u = s.children[o];
                    u.__size = 0,
                    s.children[o].traverse(function() {
                        u.__size++
                    })
                }
                s.children.sort(function(e, t) {
                    return t.__size - e.__size
                });
                var a = [s.children[0], s.children[1]],
                l = 1;
                for (o = 2; o < s.children.length; o++) a.splice(l, 0, s.children[o]),
                l += 2,
                l > a.length && (l = 1);
                s.children = a
            }
            n.traverse(function(e) {
                var t = this._graphLayout.getNodeById(e.id);
                e.layout = {
                    width: t.layout.size * 2,
                    height: t.layout.size * 2
                }
            },
            this);
            var c = new i;
            c.layerPadding = function(e) {
                return S.layout.layerDistance[e] || 200
            },
            c.run(n);
            var h = [Infinity, Infinity],
            p = [ - Infinity, -Infinity];
            n.traverse(function(e) {
                f.min(h, h, e.layout.position),
                f.max(p, p, e.layout.position)
            });
            var d = p[0] - h[0];
            d === 0 && (d = .01);
            var v = p[1] - h[1];
            n.traverse(function(n) {
                var r = this._graphLayout.getNodeById(n.id),
                i = n.layout.position[0],
                s = n.layout.position[1],
                o = s,
                u = i / d * Math.PI * 2;
                r.layout.position = [o * Math.cos(u) + e, o * Math.sin(u) + t],
                n.layout.angle = u
            },
            this);
            /*yyh修改连接关系重叠的情况*/
            /*if (n.root.children.length <= 4) {*/
                var m = Math.PI * 2 / n.root.children.length,
                g = 0;
                for (var o = 0; o < n.root.children.length; o++) {
                    var u = n.root.children[o],
                    y = u.layout.position[1],
                    b = this._graphLayout.getNodeById(u.id);
                    o === 0 ? g = u.layout.angle: g += m,
                    b.layout.position = [y * Math.cos(g) + e, y * Math.sin(g) + t]
                }
            /*}*/
        },
        C.prototype.startForceLayout = function(e) {
            var t = this._graphLayout,
            n = new l;
            n.center = [this._kgraph.getWidth() / 2, this._kgraph.getHeight() / 2],
            n.gravity = 0,
            n.scaling = Math.sqrt(t.nodes.length / 100) * 12,
            n.edgeLength = Math.max(t.nodes.length / 100 * 150, 100),
            n.preventNodeOverlap = !0,
            n.preventNodeEdgeOverlap = !0,
            t.eachNode(function(e) {
                e.layout.mass = 15,
                e.layout.layer = e.data.layerCounter
            });
            var r = S.layout.layerDistance.slice();
            for (var i = 1; i < r.length; i++) r[i] = r[i - 1] + r[i];
            n.layerConstraint = S.layout.layerConstraint,
            n.layerDistance = r;
            var s = Math.sqrt(t.nodes.length);
            t.eachEdge(function(e) {
                e.layout = {
                    weight: 20
                }
            },this),
            
            n.init(t),
            n.temperature = .04,
            this._layouting = !0;
            var o = this,
            u = 0;
            n.onupdate = function() {
                for (var r = 0; r < t.nodes.length; r++) {
                    var i = t.nodes[r];
                    i.layout.fixed && i.entity && f.copy(i.layout.position, i.entity.el.position)
                }
                o._updateNodePositions(),
                o.unactiveAll(),
                n.isStable() ? (o.stopForceLayout(), e && e.call(o)) : o._layouting && (requestAnimationFrame(function() {
                    n.step(10)
                }), u += 10)
            },
            n.step(10)
        },
        C.prototype.stopForceLayout = function() {
            var e = this._graphLayout,
            t = [];
            e.eachNode(function(e) {
                e.isEdgeNode && t.push(e)
            });
            for (var n = 0; n < t.length; n++){
            	e.removeNode(t[n]);
            } 
            this._layouting = !1
        },
        C.prototype.unactiveAll = function() {
            var e = this._zr,
            t = this._graph;
            for (var n = 0; n < t.nodes.length; n++) {
                var r = t.nodes[n];
                r.entity && r.entity.setState("normal"),
                r._outTipEntity && (this._root.removeChild(r._outTipEntity.el), r._outTipEntity = null)
            }
            for (var n = 0; n < t.edges.length; n++) {
                var i = t.edges[n];
                if(i.entity){
                	i.entity.setState("normal"); 
                }
            }
            this._currentActiveNode = null,
            e.refreshNextFrame()
        },
        C.prototype.unhoverNode = function() {
            var e = this._lastHoverNode;
            e && e.entity && (e.entity.getState() !== "active" && e.entity.setState("normal"), this._lastHoverNode = null)
        },
        /*人物节点的鼠标移上事件 的样式*/
        C.prototype.hoverNode = function(e) {
            this.unhoverEdge(),
            this.unhoverNode(),
            e.entity && (e.entity.setState("hover"), this._lastHoverNode = e)
        },
        C.prototype.unhoverEdge = function() {
            var e = this._lastHoverEdge;
            e && e.entity && (e.entity.getState() !== "active" && e.entity.setState("normal"), this._lastHoverEdge = null)
        },
        /*线节点的鼠标移上事件 的样式*/
        C.prototype.hoverEdge = function(e) {
            this.unhoverNode(),
            this.unhoverEdge(),
            e.entity && (e.entity.setState("hover"), this._lastHoverEdge = e)
        },
        C.prototype.activeEdge = function(e) {
            typeof e == "string" && (e = this._getEdgeByID(e));
            if(e && e.entity){
            	this.unactiveAll(), 
            	e.entity.setState("active");
            	/*if(e.isExtra){
            		e.entity.hidden = !1
            	}*/
            }
        },
        C.prototype.activeNode = function(e) {
            typeof e == "string" && (e = this._graph.getNodeById(e));
            var t = this._zr;
            e && e.entity && (this.unactiveAll(), e.entity.setState("active"), this._currentActiveNode = e)
        },
        /*yyh详细信息弹出层*/
        C.prototype.showEntityDetail = function(e, t) {
            var n = this,
            r = this._graphLayout;
            /*for(var i=0;i<r.nodes.length;i++){
	        	var l = r.nodes[i].outEdges;
	        	 if(l.length>0){
	             	for(var j=0;j<l.length;j++){
	             		if(l[j].entity){
	             			r.nodes[i].data.expendNodeImage="assets/images/userRelation/minusinfo.png";
	             		}
	             	}
	             	r.nodes[i].data.expendNodeImage="assets/images/userRelation/plusinfo.png";
	             }
	        	 this._createNodeEntity(r.nodes[i]);
	        }*/
            if(typeof e == "string"){
            	e = r.getNodeById(e)
            }
            var i = this._kgraph.getComponentByType("SIDEBAR");
            if(i){
            	i.hide(); 
            	setTimeout(function() {
                    s = e.data ? e.data.layerCounter: e.layerCounter;
                    if(r){
                    	i.setData(r), 
                    	t && i.show(e)
                    }else{
                    	i.setData(r);
                        if(t){
                        	i.show(e)
                        }
                        n._saveDetailToStorage(e.id, r)
                    }
                },300)
            }
        },
        /*yyh 展示详细关系*/
        C.prototype.showRelationDetail = function(e) {
            typeof e == "string" && (e = this._getEdgeByID(e));
            if (!e) return;
            var t = this._kgraph.getComponentByType("SIDEBAR");
            if (t) {
                t.hide();
                var n = this;
                setTimeout(function() {
	                if(r){
	                	t.setData(r, !0), 
	                	t.show(e)
	                }else{
	                	t.setData(r, !0);
	                	if(t){
	                		t.show(e)
	                	}
                        n._saveDetailToStorage(e.data.id, r)
	                }
	            },300)
            }
        },
        C.prototype.hideSidebar = function() {
            var e = this._kgraph.getComponentByType("SIDEBAR");
            e && e.hide()
        },
        C.prototype.showNodeEndTip = function(e) {
            typeof e == "string" && (e = graph.getNodeById(e));
            var t = this._kgraph.getComponentByType("TIP");
            t.setData(S.tip.nodeEnd, e)
        },
        C.prototype.showNodeHoverTip = function(e) {
            typeof e == "string" && (e = graph.getNodeById(e));
            var t = w.get("BKGraph_node_click_0") || 0;
            if (!t) {
                var n = this._kgraph.getComponentByType("TIP");
                n.setData(S.tip.node, e)
            }
        },
        C.prototype.showEdgeClickTip = function(e, t) {
            typeof e == "string" && (e = this._getEdgeByID(e));
            if (!e) return;
            var n = w.get("BKGraph_edge_click_0") || 0;
            if (!n) {
                this.activeEdge(e);
                var r = this._kgraph.getComponentByType("TIP"),
                i = t ? S.tip.edgeOther: S.tip.edge;
                r.setData(i, e, !0)
            }
        },
        C.prototype.hideTip = function() {
            var e = this._kgraph.getComponentByType("TIP");
            e && e.hide()
        },
        C.prototype.moveToEntity = function(e, t) {
            var n = this._graph;
            typeof e == "string" && (e = n.getNodeById(e));
            var r = this._zr;
            if (!e) return;
            var i = e.entity,
            s = r.painter.getLayer(0),
            o = Array.prototype.slice.call(i.el.position);
            f.mul(o, o, s.scale),
            f.sub(o, [r.getWidth() / 2, r.getHeight() / 2], o),
            this.moveTo(o[0], o[1], t)
        },
        C.prototype.moveToRelation = function(e, t) {
            typeof e == "string" && (e = this._getEdgeByID(e));
            if (!e) return;
            var n = this._zr,
            r = e.node1.entity.el.position,
            i = e.node2.entity.el.position,
            s = f.add([], r, i);
            s[0] /= 2,
            s[1] /= 2;
            var o = n.painter.getLayer(0);
            f.mul(s, s, o.scale),
            f.sub(s, [n.getWidth() / 2, n.getHeight() / 2], s),
            this.moveTo(s[0], s[1], t)
        },
        C.prototype.moveTo = function(e, t, n) {
            var r = this._zr,
            i = r.painter.getLayers();
            if (S.enableAnimation) {
                var s = this;
                s._animating = !0,
                r.animation.animate(i[0]).when(800, {
                    position: [e, t]
                }).during(function() {
                    r.refreshNextFrame()
                }).done(function() {
                    s._animating = !1,
                    n && n()
                }).start("CubicInOut")
            } else {
                var o = i[0].position;
                o[0] = e,
                o[1] = t,
                r.refreshNextFrame(),
                n && n()
            }
            this.hideTip()
        },
        C.prototype.moveLeft = function(e) {
            var t = this._zr,
            n = t.painter.getLayer(0),
            r = Array.prototype.slice.call(n.position);
            r[0] += t.getWidth() * .6,
            this.moveTo(r[0], r[1], e)
        },
        C.prototype.moveRight = function(e) {
            var t = this._zr,
            n = t.painter.getLayer(0),
            r = Array.prototype.slice.call(n.position);
            r[0] -= t.getWidth() * .6,
            this.moveTo(r[0], r[1], e)
        },
        C.prototype.moveTop = function(e) {
            var t = this._zr,
            n = t.painter.getLayer(0),
            r = Array.prototype.slice.call(n.position);
            r[1] += t.getHeight() * .6,
            this.moveTo(r[0], r[1], e)
        },
        C.prototype.moveDown = function(e) {
            var t = this._zr,
            n = t.painter.getLayer(0),
            r = Array.prototype.slice.call(n.position);
            r[1] -= t.getHeight() * .6,
            this.moveTo(r[0], r[1], e)
        },
        C.prototype.zoomIn = function() {
            var e = this._zr,
            t = e.painter.getLayer(0);
            t.__zoom = t.__zoom || 1,
            this.zoomTo(t.__zoom * 1.3),
            this._updateNodePositions();
        },
        C.prototype.zoomOut = function() {
            var e = this._zr,
            t = e.painter.getLayer(0);
            t.__zoom = t.__zoom || 1,
            this.zoomTo(t.__zoom / 1.3);
            this._updateNodePositions();
        },
        C.prototype.zoomTo = function(e, t) {
            var n = this._zr,
            r = n.getWidth() / 2,
            i = n.getHeight() / 2,
            s = n.painter.getLayer(0);
            s.__zoom = s.__zoom || 1,
            e = Math.min(Math.max(e, .5), 1.5);
            var o = e / s.__zoom,
            u = Array.prototype.slice.call(s.scale),
            a = Array.prototype.slice.call(s.position);
            a[0] -= (r - a[0]) * (o - 1),
            a[1] -= (i - a[1]) * (o - 1),
            u[0] *= o,
            u[1] *= o,
            n.animation.clear(),
            n.animation.animate(s).when(800, {
                position: a,
                scale: u,
                __zoom: e
            }).during(function() {
                s.dirty = !0,
                n.refreshNextFrame()
            }).done(function() {
                t && t()
            }).start("CubicInOut"),
            this.hideTip()
        },
        C.prototype.uncollapse = function() {
            var e = this._zr;
            this._graph.eachNode(function(e) {
                e.entity || (this._createNodeEntity(e), e.canCollapse = !0)
            },
            this),
            this._graph.eachEdge(function(e) {
                e.entity || (this._createEdgeEntity(e), e.canCollapse = !0)
            },
            this),
            this._syncHeaderBarExplorePercent(),
            e.refreshNextFrame()
        },
        C.prototype.collapse = function() {
            var e = this._zr;
            this._graph.eachNode(function(e) {
                e.canCollapse && (e.entity.stopAnimationAll(), this._root.removeChild(e.entity.el), e.canCollapse = !1, e.entity = null, this._nodeEntityCount--)
            },
            this),
            this._graph.eachEdge(function(e) {
                e.canCollapse && (e.entity.stopAnimationAll(), this._root.removeChild(e.entity.el), e.canCollapse = !1, e.entity = null, S.enableAnimation && this._extraEdgeBundle.removeEdge(e))
            },
            this),
            this._syncHeaderBarExplorePercent(),
            e.refreshNextFrame()
        },
        C.prototype.toJSON = function() {
            var e = this._graph,
            t = {
                viewport: {
                    x: 0,
                    y: 0,
                    width: this._zr.getWidth(),
                    height: this._zr.getHeight()
                },
                entities: [],
                relations: []
            };
            return e.eachNode(function(e) {
                e.data.position = e.layout.position,
                t.entities.push(e.data)
            }),
            e.eachEdge(function(e) {
                t.relations.push(e.data)
            }),
            t
        },
        C.prototype.getExplorePercent = function() {
            var e = this._graph.nodes;
            return (this._nodeEntityCount - this._baseEntityCount) / (e.length - this._baseEntityCount)
        },
        C.prototype._getEdgeByID = function(e) {
            var t = this._graph;
            for (var n = 0; n < t.edges.length; n++) if (t.edges[n].data.id === e) return e = t.edges[n],
            e
        },
        C.prototype._loadStorage = function() {
            if (!window.localStorage) return;
            var e = this._mainNode.id,
            t = this._graph,
            n = localStorage.BKGraph_expanded;
            if (!n) return;
            n = JSON.parse(n);
            if (n[e]) {
                var r = n[e];
                for (var i = 0; i < r.entities.length; i++) {
                    var s = t.getNodeById(r.entities[i]);
                    s && !s.entity && this._createNodeEntity(s)
                }
                for (var i = 0; i < r.relations.length; i++) {
                    var o = r.relations[i].split(","),
                    u = t.getEdge(o[0], o[1]);
                    u && !u.entity && this._createEdgeEntity(u)
                }
            }
            this._syncHeaderBarExplorePercent()
        },
        C.prototype._saveStorage = function() {
            if (!window.localStorage) return;
            var e = this._mainNode.id,
            t = [],
            n = [];
            this._graph.eachNode(function(e) {
                e.entity && t.push(e.id)
            }),
            this._graph.eachEdge(function(e) {
                e.entity && n.push(e.node1.id + "," + e.node2.id)
            });
            var r = localStorage.BKGraph_expanded;
            r ? r = JSON.parse(r) : r = {},
            r[e] = {
                entities: t,
                relations: n
            },
            localStorage.BKGraph_expanded = JSON.stringify(r)
        },
        C.prototype._loadDetailFromStorage = function(e) {
            if (!window.sessionStorage) return;
            var t = sessionStorage.BKGraph_detail_data,
            n = null;
            if (!t) return;
            return t = JSON.parse(t),
            t[e] && (n = t[e]),
            n
        },
        C.prototype._saveDetailToStorage = function(e, t) {
            if (!window.sessionStorage) return;
            var n = sessionStorage.BKGraph_detail_data;
            n ? n = JSON.parse(n) : n = {},
            n[e] = t;
            try {
                sessionStorage.BKGraph_detail_data = JSON.stringify(n)
            } catch(r) {
                r.name == "QuotaExceededError" && sessionStorage.removeItem("BKGraph_detail_data")
            }
        },
        C.prototype._findCircles = function(e) {
            function t(t) {
                for (var n = 0; n < e.length; n++) if (t.indexOf(e[n]) >= 0) return ! 0;
                return ! 1
            }
            var n = E.findFromGraph(this._graph, 3),
            r = [];
            for (var i = 0; i < n.length; i++) {
                var s = n[i],
                o = s.nodes.length;
                for (var u = 0; u < o; u++) {
                    var a = s.nodes[u],
                    f = s.nodes[(u + 1) % o],
                    l = this._graph.getEdge(a, f) || this._graph.getEdge(f, a);
                    if (l && t(l.data.relationName)) continue;
                    break
                }
                if (u == s.nodes.length) {
                    r.push(s);
                    for (var c = 0; c < s.edges.length; c++) s.edges[c].isSpecial = !0
                }
            }
            return r
        },
        C.prototype._entryAnimation = function(e) {
            var t = this._zr,
            n = this,
            r = new u({
                style: {
                    x: t.getWidth() / 2,
                    y: t.getHeight() / 2,
                    r: 70
                }
            });
            this._root.clipShape = r,
            this._root.modSelf(),
            t.refreshNextFrame(),
            t.animation.animate(r.style).when(1e3, {
                r: Math.max(t.getWidth(), t.getHeight())
            }).during(function() {
                n._root.modSelf(),
                t.refreshNextFrame()
            }).done(function() {
                n._root.clipShape = null,
                e && e()
            }).start()
        },
        C.prototype._syncOutTipEntities = function() {
            var e = this._zr,
            t = this._currentActiveNode;
            if (!t) return;
            var n = this._kgraph.getComponentByType("HEADERBAR"),
            r = this._kgraph.getComponentByType("SEARCHBAR"),
            i = 0,
            s = 0;
            n && (i = n.el.clientHeight);
            if (r) {
                var s = parseInt(g.getStyle(r.el, "bottom"));
                s += r.el.clientHeight
            }
            var o = -parseInt(g.getStyle(this.el, "left")),
            u = this._zr.painter.getLayer(0),
            a = {
                x: ( - u.position[0] + o) / u.scale[0],
                y: ( - u.position[1] + i) / u.scale[1],
                width: (e.getWidth() - 2 * o) / u.scale[0],
                height: (e.getHeight() - i - s) / u.scale[1]
            };
            for (var l = 0; l < t.edges.length; l++) {
                var c = t.edges[l],
                h = c.node1 === t ? c.node2: c.node1;
                //if (t.data.layerCounter === 0 && c.isExtra) continue;
                if (!c.entity || !h.entity) continue;
                if (!h.entity.isInsideRect(a)) {
                    var d = c.entity.intersectRect(a),
                    v = Infinity,
                    m,
                    y;
                    for (var b = 0; b < d.length; b++) {
                        var w = f.dist(d[b].point, h.entity.el.position);
                        w < v && (w = v, m = d[b].point, y = d[b].side)
                    }
                    if (y) {
                        h._outTipEntity || (h._outTipEntity = new p({
                            label: h.data.name
                        }), h._outTipEntity.initialize(e), this._root.addChild(h._outTipEntity.el));
                        var E = h._outTipEntity.el.position;
                        f.copy(E, m);
                        switch (y) {
                        case "top":
                            break;
                        case "left":
                            E[0] += 25;
                            break;
                        case "bottom":
                            E[1] -= 25;
                            break;
                        case "right":
                            E[0] -= 25
                        }
                        h._outTipEntity.el.modSelf()
                    } else h._outTipEntity && (this._root.removeChild(h._outTipEntity.el), h._outTipEntity = null)
                } else h._outTipEntity && (this._root.removeChild(h._outTipEntity.el), h._outTipEntity = null)
            }
        },
        C.prototype._growNodeAnimation = function(e, t, n) {
            var r = this._zr,
            i = this._graph.getEdge(t.id, e.id) || this._graph.getEdge(e.id, t.id),
            s = this,
            o = e.entity.radius;
            e.entity.setRadius(1),
            this._animating = !0,
            r.refreshNextFrame(),
            i.entity.animateLength(r, 300, 0, t.entity,
            function() {
                e.entity.animateRadius(o, 500,
                function() {
                    s._animating = !1,
                    t.entity.radius = t.layout.size,
                    e.entity.radius = e.layout.size,
                    i.entity.update()
                })
            })
        },
        /*展开子关系*/
        C.prototype.activeNodeAndShowAdjacency = function(e) {
        	var rr = this;
            $.ajax({
             	url : 'assets/js/json2.txt',
         		data : 'jsonString', 
         		type : "POST",
         		success : function(jsonString){
         			var ee = eval("("+jsonString+")");
         			rr.setData(ee,e);
         		},error:function(jsonString){
         	        alert('服务器异常！');
         		}
        	})
        },
        /*收缩子关系yyh*/
        C.prototype.activeNodeAndDisplayAdjacency = function(e) {
        	this.expandNodess(e);
        },
        /*收缩子关系yyh*/
        C.prototype.expandNodess = function(e) {
        	var tempId = "";
            for (var n = 0; n < e.outEdges.length; n++) {
                var r = e.outEdges[n];
                var pId = e.id;
                var ids = r.node2.id;
                tempId += pId+","+ids+",";
                var pLayer = e.data.layerCounter;
                var cLayer = r.node2.data.layerCounter;
                if(r.node2.outEdges.length>0&&r.node2.entity) {
                	for(var a=0;a<r.node2.outEdges.length;a++){
                		if(r.node2.outEdges[a].entity){
                			if(pLayer!=cLayer){
                        		this.expandNodess(r.node2);
                        	}
                		}
                	}
                }
                var tempArr = [];
                if(r.node2.inEdges.length>1){
	                for(var a=0;a<r.node2.inEdges.length;a++){
	            		var idd = r.node2.inEdges[a].node1.id;
	            		var isEntity = r.node2.inEdges[a];
	            		tempArr.push({
	            			id: idd,
	            			isEntity:isEntity
	            		})
	            	}
	                var a=0;
	                var b=0;
	                for(var i=0;i<tempArr.length;i++){
            			idy = tempArr[i].id;
            			isEntity = tempArr[i].isEntity;
            			if(isEntity.entity){
            				b++;
            				if(tempId.indexOf(idy)!=-1){
            					a++;
            				}
                		}
            		}
	                if(a==b&&a!=0&&b!=0){
        				this._root.removeChild(r.node2.entity.el);//删除节点
            			$(r.node2).removeProp("entity");
        			}
                }else{
                	if(r.node2.entity){
                		this._root.removeChild(r.node2.entity.el);//删除节点
                		$(r.node2).removeProp("entity");
                	}
                }
                if(r.entity){
	                this._root.removeChild(r.entity.el)//删除连接关系
	            	$(r).removeProp("entity");
                }
            }
            return e
        },
        /*yyh展开子人物关系**/
        C.prototype.expandNode = function(e) {
            var t = this._zr,
            n = this,
            r = [];
            for (var i = 0; i < e.edges.length; i++) {
                var s = e.edges[i],
                o = s.node1 === e ? s.node2: s.node1;
                /*if (s.isExtra) continue;*/
                var u = !1;
                if (!o.entity) {
                    u = !0,
                    /*展开子关系关键代码*/
                    this._createNodeEntity(o),
                    r.push(o.id, o.data.layerCounter);
                    for (var a = 0,f = o.inEdges.length; a < f; a++) {
                        var l = o.inEdges[a];
                        l.node1 === e && r.push(l.data.id)
                    }
                }
                /*展开子关系关键代码*/
                s.entity || this._createEdgeEntity(s),
                //加载动画
                S.enableAnimation && u && this._growNodeAnimation(o, e, Math.random() * 500)
            }
            var c = [];
            this._graph.eachNode(function(e, t) {
                c[e.data.layerCounter] ? c[e.data.layerCounter]++:c[e.data.layerCounter] = 1
            }),
            r.length && m({
                type: "zhishitupuexpand",
                target: r.join(","),
                area: "entity",
                extend: c.join(",")
            }),
            this._syncHeaderBarExplorePercent(),
            t.refreshNextFrame()
        },
        /*yyh关键代码*/
        C.prototype._createNodeEntity = function(e) {
            var t = this._zr;
            if(e.data.nextNode==true){
            	if(e.data.layerCounter==0){
            		e.data.expendNodeImage="assets/images/userRelation/minusinfo.png";
            	}else{
            		e.data.expendNodeImage="assets/images/userRelation/plusinfo.png";
            	}
            }
            /*if(e.outEdges.length>0){
            	if(e.outEdges.length>0&&e.data.layerCounter>="1"){
            		e.data.expendNodeImage="assets/images/userRelation/plusinfo.png";
            	}else{
            		e.data.expendNodeImage="assets/images/userRelation/minusinfo.png";
            	}
            }*/
            n = new c({
                radius: e.layout.size,
                label: e.data.name,
                image: e.data.image,
                expendNodeImage: e.data.expendNodeImage,
                markIcon: e.data.markIcon,
                markInfo: e.data.markInfo,
                personId: e.data.id,
                draggable: this.draggable,
                weightType: e.data.weightType,
                states: e === this.getMainNode() ? S.mainNodeStates: S.nodeStates
            });
            n.initialize(this._zr),
            f.copy(n.el.position, e.layout.position);
            var r = this;
            /*yyh 鼠标移上事件*/
            n.bind("mouseover",function() {
            	if (r._animating) return;
            	if(r._lastHoverNode !== e){
            		//鼠标移上提示
            		r.showNodeHoverTip(e) 
            		//鼠标移上事件改变样式
            		r.hoverNode(e)
            	}
            }),
            //dispatch事件分发//if (foo) bar(); ==> foo&&bar(); //if (!foo) bar(); ==> foo||bar();
            n.el._children[0].bind("click",function(){
            	var srcImg = this.style.image.src;
            	if(srcImg.indexOf("plusinfo.png")!=-1){
            		if (r._animating) return;
                	if(r._lastHoverNode !== e){
                		r.dispatch("click:entity", e.data), 
                		r.activeNodeAndShowAdjacency(e),//展开子关系
                		m({
                            type: "zhishitupuhover",
                            target: [e.id, e.data.layerCounter].join(","),
                            area: "entity"
                        })
                	}
                	var subStr = srcImg.substring(srcImg.indexOf("plusinfo.png"),srcImg.length);
                	this.style.image.src = srcImg.replace(subStr,"minusinfo.png");
            	}else{
                	if(r._lastHoverNode !== e){
                		r.dispatch("click:entity", e.data), 
                		r.activeNodeAndDisplayAdjacency(e);//收缩子关系
                		m({
                            type: "zhishitupuhidden",
                            target: [e.id, e.data.layerCounter].join(","),
                            area: "entity"
                        })
                	}
                	var subStr = srcImg.substring(srcImg.indexOf("minusinfo.png"),srcImg.length);
                	this.style.image.src = srcImg.replace(subStr,"plusinfo.png");
            	}
            }),
            /*yyh 鼠标离开事件*/
            n.bind("mouseout",function() {
                r.unhoverNode()
            }),
            /*yyh 鼠标单击事件*/
            n.bind("click",function() {
            	/*添加备注*/
            	var aa = this;
            	$('#addMark').unbind("click");
            	$("#addMark").click(function(){
            		if(e){
            			n.drawBeline(e);
            			$("#textarea")[0].value = "";
                		$('#saveBtn').unbind("click");
                		$("#saveBtn").click(function(){
                			e.entity.markModify(e,r);
                    	});
            		}
            	});
                r.dispatch("click:entity", e),
                r.hideTip();
                var t = w.get("BKGraph_node_click_0") || 0;
                t || w.set("BKGraph_node_click_0", e.id, {
                    expires: 31104e4
                }),
                m({
                    type: "zhishitupuclick",
                    target: e.id + "," + e.data.layerCounter,
                    area: "entity"
                });
                if (n.getState() === "active") {
                    r._currentActiveNode = null,
                    r.unactiveAll(),
                    r.hideSidebar();
                    return
                }
                r._syncOutTipEntities(),
                r.activeNode(e)
            });
            n.bind("dblclick",function() {
            	m({
                    type: "zhishitupudblclick",
                    target: e.id + "," + e.data.layerCounter,
                    area: "entity"
                });
                r.showEntityDetail(e, !0)//双击人物头像弹出详细信息的方法调用
                r.activeNode(e)
            }),
            n.bind("dragstart",function() {
                e.layout.fixed = !0,
                g.addEventListener(document.body, "mousemove", i)
            }),
            n.bind("dragend",function() {
                e.layout.fixed = !1,
                g.removeEventListener(document.body, "mousemove", i)
            });
            var i = function() {
                r.unactiveAll();
                for (var n = 0; n < e.edges.length; n++){
                	if(e.edges[n].entity){
                		e.edges[n].entity.update();
                	}
                } 
                S.enableAnimation && r._extraEdgeBundle.update(t),
                f.copy(e.layout.position, e.entity.el.position),
                t.refreshNextFrame()
            };
            return e.entity = n,
            this._root.addChild(n.el),
            this._nodeEntityCount++,
            n
        },
        C.prototype._createEdgeEntity = function(e) {
            var t = this,
            n = this._zr;
            if (e.node1.entity && e.node2.entity) {
                var r = new h({
                    sourceEntity: e.node1.entity,
                    targetEntity: e.node2.entity,
                    label: e.data.relationName,
                    layerCounter: Math.max(e.node1.data.layerCounter, e.node2.data.layerCounter),
                    //isExtra: e.isExtra,
                    weightType:e.data.weightType,
                    states: S.edgeStates
                });
                //return e.isExtra && (S.enableAnimation && this._extraEdgeBundle.addEdge(e), r.hidden = !0),
                r.initialize(this._zr),
                r.bind("click",function() {
                    t.dispatch("click:relation", e),
                    m({
                        type: "zhishitupuclick",
                        target: [e.node1.id, e.node1.data.layerCounter, e.node2.id, e.node2.data.layerCounter, e.data.id ? 1 : 0, e.isSpecial ? 1 : 0].join(","),
                        area: "relation"
                    });
                    if (r.getState() == "active") {
                        t.unactiveAll(),
                        t.hideSidebar();
                        return
                    }
                    this.activeEdge(e);
                    var n = w.get("BKGraph_edge_click_0") || 0;
                    n || (t.hideTip(), w.set("BKGraph_edge_click_0", e.data.id, {
                        expires: 31104e4
                    })),
                    this.showRelationDetail(e)
                },
                this),
                r.bind("mouseover",function() {
                    t._lastHoverEdge !== e && (t.dispatch("mouseover:relation", e.data), t.hoverEdge(e))
                }),
                r.bind("mouseout",function() {
                    t.unhoverEdge()
                }),
                e.entity = r,
                this._root.addChild(r.el),
                r
            }
        },
        C.prototype._updateNodePositions = function() {
            var e = this._zr,
            t = this._graph;
            for (var n = 0; n < t.nodes.length; n++) {
                var r = t.nodes[n];
                r.entity && (r.layout.fixed ? f.copy(r.layout.position, r.entity.el.position) : f.copy(r.entity.el.position, r.layout.position), e.modGroup(r.entity.el.id))
            }
            for (var n = 0; n < t.edges.length; n++) {
                var i = t.edges[n];
                i.entity && i.entity.update(e)
            }
            S.enableAnimation && this._extraEdgeBundle.update(e),
            e.refreshNextFrame()
        },
        C.prototype._syncHeaderBarExplorePercent = function() {
            S.isPlat || this._saveStorage()
        },
        C.prototype._culling = function() {
            var e = this._graph,
            t = this._zr;
            if (!e) return;
            var n = -parseInt(g.getStyle(this.el, "right")),
            r = t.painter.getLayer(1),
            i = t.getWidth(),
            s = t.getHeight();
            r.updateTransform();
            var o = this._zr.painter.getLayer(0),
            u = {
                x: -o.position[0] / o.scale[0],
                y: -o.position[1] / o.scale[1],
                width: (t.getWidth() - n) / o.scale[0],
                height: t.getHeight() / o.scale[1]
            },
            a = 0,
            l = 0;
            for (var c = 0; c < e.nodes.length; c++) {
                var h = e.nodes[c];
                if(h.entity){
                	h.entity.el.ignore = h.entity.hidden || !h.entity.isInsideRect(u);
                	if(!h.entity.el.ignore){
                		if(this._isFirstFrame){
                			a++, 
                			h.entity.loadImage(t,function() {
                                a--,
                                l++,
                                a === 0 && m({
                                    type: "zhishitupuscreenrendered",
                                    imageCount: l
                                })
                            },
                            function() {
                                a--,
                                a === 0 && m({
                                    type: "zhishitupuscreenrendered",
                                    imageCount: l
                                })
                            })
                		}else{
                			h.entity.loadImage(t)
                		}
                	}
                    f.min(this._min, this._min, h.entity.el.position), 
                    f.max(this._max, this._max, h.entity.el.position)
                }
            }
            for (var c = 0; c < e.edges.length; c++) {
                var p = e.edges[c];
                p.entity && (p.entity.el.ignore = p.entity.hidden || !p.entity.isInsideRect(u))
            }
            this._isFirstFrame = !1
        },
        s.inherits(C, a),
        C
    }),
    function(e) {
        function t(e, t) {
            for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
            return e
        }
        function n() {
            this.raw = [],
            this.length = 0
        }
        function s() {
            return "___" + i++
        }
        function o(e, t) {
            var n = new Function;
            n.prototype = t.prototype,
            e.prototype = new n,
            e.prototype.constructor = e
        }
        function a(e) {
            return u[e]
        }
        function l(e) {
            return '"' + e.replace(/\x5C/g, "\\\\").replace(/"/g, '\\"').replace(/\x0A/g, "\\n").replace(/\x09/g, "\\t").replace(/\x0D/g, "\\r") + '"'
        }
        function c(e) {
            return e.replace(/[\^\[\]\$\(\)\{\}\?\*\.\+]/g,
            function(e) {
                return "\\" + e
            })
        }
        function h(e) {
            var t = arguments;
            return e.replace(/\{([0-9]+)\}/g,
            function(e, n) {
                return t[n - 0 + 1]
            })
        }
        function g(e) {
            return e = e.replace(/^\s*\*/, ""),
            h('gv({0},["{1}"])', l(e), e.replace(/\[['"]?([^'"]+)['"]?\]/g,
            function(e, t) {
                return "." + t
            }).split(".").join('","'))
        }
        function y(e, t, n, r, i, s) {
            var o = n.length,
            u = e.split(t),
            a = 0,
            f = [];
            for (var l = 0,
            c = u.length; l < c; l++) {
                var h = u[l];
                if (l) {
                    var p = 1;
                    a++;
                    for (;;) {
                        var d = h.indexOf(n);
                        if (d < 0) {
                            f.push(a > 1 && p ? t: "", h);
                            break
                        }
                        a = r ? a - 1 : 0,
                        f.push(a > 0 && p ? t: "", h.slice(0, d), a > 0 ? n: ""),
                        h = h.slice(d + o),
                        p = 0;
                        if (a === 0) break
                    }
                    a === 0 && (i(f.join("")), s(h), f = [])
                } else h && s(h)
            }
            a > 0 && f.length > 0 && (s(t), s(f.join("")))
        }
        function b(e, t, n) {
            var r = [],
            i = t.options,
            s = "",
            o = "",
            u = "",
            a = "",
            f;
            return n && (s = "ts(", o = ")", u = d, a = v, f = i.defaultFilter),
            y(e, i.variableOpen, i.variableClose, 1,
            function(e) {
                n && e.indexOf("|") < 0 && f && (e += "|" + f);
                var i = e.indexOf("|"),
                l = (i > 0 ? e.slice(0, i) : e).replace(/^\s+/, "").replace(/\s+$/, ""),
                c = i > 0 ? e.slice(i + 1) : "",
                h = l.indexOf("*") === 0,
                p = [h ? "": s, g(l), h ? "": o];
                if (c) {
                    c = b(c, t);
                    var d = c.split("|");
                    for (var v = 0,
                    m = d.length; v < m; v++) {
                        var y = d[v];
                        /^\s*([a-z0-9_-]+)(\((.*)\))?\s*$/i.test(y) && (p.unshift('fs["' + RegExp.$1 + '"]('), RegExp.$3 && p.push(",", RegExp.$3), p.push(")"))
                    }
                }
                r.push(u, p.join(""), a)
            },
            function(e) {
                r.push(u, n ? l(e) : e, a)
            }),
            r.join("")
        }
        function w(e, t) {
            this.value = e,
            this.engine = t
        }
        function E(e, t) {
            this.value = e,
            this.engine = t,
            this.children = [],
            this.cloneProps = []
        }
        function S(e, t) {
            var n = e.stack,
            r = t ? n.find(function(e) {
                return e instanceof t
            }) : n.bottom();
            if (r) {
                var i;
                while ((i = n.top()) !== r) {
                    if (!i.autoClose) throw new Error(i.type + " must be closed manually: " + i.value);
                    i.autoClose(e)
                }
                r.close(e)
            }
            return r
        }
        function T(e, t) {
            if (!/^\s*([a-z0-9\/_-]+)\s*(\(\s*master\s*=\s*([a-z0-9\/_-]+)\s*\))?\s*/i.test(e)) throw new Error("Invalid " + this.type + " syntax: " + e);
            this.master = RegExp.$3,
            this.name = RegExp.$1,
            E.call(this, e, t),
            this.blocks = {}
        }
        function N(e, t) {
            if (!/^\s*([a-z0-9\/_-]+)\s*$/i.test(e)) throw new Error("Invalid " + this.type + " syntax: " + e);
            this.name = RegExp.$1,
            E.call(this, e, t),
            this.cloneProps = ["name"]
        }
        function C(e, t) {
            if (!/^\s*([a-z0-9\/_-]+)\s*$/i.test(e)) throw new Error("Invalid " + this.type + " syntax: " + e);
            this.name = RegExp.$1,
            E.call(this, e, t),
            this.cloneProps = ["name", "state", "blocks"],
            this.blocks = {}
        }
        function k(e, t) {
            if (!/^\s*([a-z0-9_]+)\s*=([\s\S]*)$/i.test(e)) throw new Error("Invalid " + this.type + " syntax: " + e);
            this.name = RegExp.$1,
            this.expr = RegExp.$2,
            E.call(this, e, t),
            this.cloneProps = ["name", "expr"]
        }
        function L(e, t) {
            if (!/^\s*([a-z0-9_-]+)\s*(\(([\s\S]*)\))?\s*$/i.test(e)) throw new Error("Invalid " + this.type + " syntax: " + e);
            this.name = RegExp.$1,
            this.args = RegExp.$3,
            E.call(this, e, t),
            this.cloneProps = ["name", "args"]
        }
        function A(e, t) {
            if (!/^\s*([a-z0-9\/_-]+)\s*(\(([\s\S]*)\))?\s*$/i.test(e)) throw new Error("Invalid " + this.type + " syntax: " + e);
            this.name = RegExp.$1,
            this.args = RegExp.$3,
            E.call(this, e, t),
            this.cloneProps = ["name", "args"]
        }
        function O(e, t) {
            var n = new RegExp(h("^\\s*({0}[\\s\\S]+{1})\\s+as\\s+{0}([0-9a-z_]+){1}\\s*(,\\s*{0}([0-9a-z_]+){1})?\\s*$", c(t.options.variableOpen), c(t.options.variableClose)), "i");
            if (!n.test(e)) throw new Error("Invalid " + this.type + " syntax: " + e);
            this.list = RegExp.$1,
            this.item = RegExp.$2,
            this.index = RegExp.$4,
            E.call(this, e, t),
            this.cloneProps = ["list", "item", "index"]
        }
        function M(e, t) {
            E.call(this, e, t)
        }
        function _(e, t) {
            M.call(this, e, t)
        }
        function D(e, t) {
            E.call(this, e, t)
        }
        function H(e, t) {
            t.target = e;
            var n = t.engine,
            r = e.name;
            if (n.targets[r]) switch (n.options.namingConflict) {
            case "override":
                n.targets[r] = e,
                t.targets.push(r);
            case "ignore":
                break;
            default:
                throw new Error("Target exists: " + r)
            } else n.targets[r] = e,
            t.targets.push(r)
        }
        function j(e, t) {
            B[e] = t,
            t.prototype.type = e
        }
        function F(e) {
            this.options = {
                commandOpen: "<!--",
                commandClose: "-->",
                commandSyntax: /^\s*(\/)?([a-z]+)\s*(?::([\s\S]*))?$/,
                variableOpen: "${",
                variableClose: "}",
                defaultFilter: "html"
            },
            this.config(e),
            this.targets = {},
            this.filters = t({},
            f)
        }
        function I(e, t) {
            function f() {
                var e;
                if (a.length > 0 && (e = a.join(""))) {
                    var n = new w(e, t);
                    n.beforeAdd(u),
                    o.top().addChild(n),
                    a = [],
                    t.options.strip && u.current instanceof E && (n.value = e.replace(/^[\x20\t\r]*\n/, "")),
                    u.current = n
                }
            }
            var r = t.options.commandOpen,
            i = t.options.commandClose,
            s = t.options.commandSyntax,
            o = new n,
            u = {
                engine: t,
                targets: [],
                stack: o,
                target: null
            },
            a = [],
            l;
            return y(e, r, i, 0,
            function(e) {
                var n = s.exec(e);
                if (n && (l = B[n[2].toLowerCase()]) && typeof l == "function") {
                    f();
                    var o = u.current;
                    t.options.strip && o instanceof w && (o.value = o.value.replace(/\r?\n[\x20\t]*$/, "\n")),
                    n[1] ? o = S(u, l) : (o = new l(n[3], t), typeof o.beforeOpen == "function" && o.beforeOpen(u), o.open(u)),
                    u.current = o
                } /*else 
                	n.test(e) || a.push(r, e, i);
                	l = null*/
            },
            function(e) {
                a.push(e)
            }), 
            f(), 
            S(u), 
            u.targets
        }
        n.prototype = {
                push: function(e) {
                        this.raw[this.length++] = e
                },
                pop: function() {
                        if (this.length > 0) {
                                var e = this.raw[--this.length];
                                return this.raw.length = this.length,
                                e
                        }
                },
                top: function() {
                        return this.raw[this.length - 1]
                },
                bottom: function() {
                        return this.raw[0]
                },
                find: function(e) {
                        var t = this.length;
                        while (t--) {
                                var n = this.raw[t];
                                if (e(n)) return n
                        }
                }
        };
        var i = 178245,
        u = {
                "&": "&amp;",
                "<": "&lt;",
                ">": "&gt;",
                '"': "&quot;",
                "'": "&#39;"
        },
        f = {
                html: function(e) {
                        return e.replace(/[&<>"']/g, a)
                },
                url: encodeURIComponent,
                raw: function(e) {
                        return e
                }
        },
        p = 'var r="";', d = "r+=", v = ";", m = "return r;";typeof navigator != "undefined" && /msie\s*([0-9]+)/i.test(navigator.userAgent) && RegExp.$1 - 0 < 8 && (p = "var r=[],ri=0;", d = "r[ri++]=", m = 'return r.join("");'), w.prototype = {
                getRendererBody: function() {
                        var e = this.value,
                        t = this.engine.options;
                        return ! e || t.strip && /^\s*$/.test(e) ? "": b(e, this.engine, 1)
                },
                clone: function() {
                        return this
                }
        },
        E.prototype = {
                addChild: function(e) {
                        this.children.push(e)
                },
                open: function(e) {
                        var t = e.stack.top();
                        t && t.addChild(this),
                        e.stack.push(this)
                },
                close: function(e) {
                        e.stack.top() === this && e.stack.pop()
                },
                getRendererBody: function() {
                        var e = [],
                        t = this.children;
                        for (var n = 0; n < t.length; n++) e.push(t[n].getRendererBody());
                        return e.join("")
                },
                clone: function() {
                        var e = new this.constructor(this.value, this.engine);
                        for (var t = 0,
                        n = this.children.length; t < n; t++) e.addChild(this.children[t].clone());
                        for (var t = 0,
                        n = this.cloneProps.length; t < n; t++) {
                                var r = this.cloneProps[t];
                                e[r] = this[r]
                        }
                        return e
                }
        };
        var x = 'data=data||{};var v={},fs=engine.filters,hg=typeof data.get=="function",gv=function(n,ps){var p=ps[0],d=v[p];if(d==null){if(hg){return data.get(n);}d=data[p];}for(var i=1,l=ps.length;i<l;i++)if(d!=null)d = d[ps[i]];return d;},ts=function(s){if(typeof s==="string"){return s;}if(s==null){s="";}return ""+s;};';o(T, E), o(N, E), o(C, E), o(k, E), o(L, E), o(A, E), o(O, E), o(M, E), o(_, M), o(D, M);
        var P = {
                READING: 1,
                READED: 2,
                APPLIED: 3,
                READY: 4
        };
        C.prototype.applyMaster = T.prototype.applyMaster = function(e) {
                function n(e) {
                        var r = e.children;
                        if (r instanceof Array) for (var i = 0,
                        s = r.length; i < s; i++) {
                                var o = r[i];
                                o instanceof N && t[o.name] && (o = r[i] = t[o.name]),
                                n(o)
                        }
                }
                if (this.state >= P.APPLIED) return 1;
                var t = this.blocks,
                r = this.engine.targets[e];
                if (r && r.applyMaster(r.master)) return this.children = r.clone().children,
                n(this),
                this.state = P.APPLIED,
                1
        },
        T.prototype.isReady = function() {
                function n(r) {
                        for (var i = 0,
                        s = r.children.length; i < s; i++) {
                                var o = r.children[i];
                                if (o instanceof C) {
                                        var u = e.targets[o.name];
                                        t = t && u && u.isReady(e)
                                } else o instanceof E && n(o)
                        }
                }
                if (this.state >= P.READY) return 1;
                var e = this.engine,
                t = 1;
                if (this.applyMaster(this.master)) return n(this),
                t && (this.state = P.READY),
                t
        },
        T.prototype.getRenderer = function() {
                if (this.renderer) return this.renderer;
                if (this.isReady()) {
                        var e = new Function("data", "engine", [x, p, this.getRendererBody(), m].join("\n")),
                        t = this.engine;
                        return this.renderer = function(n) {
                                return e(n, t)
                        },
                        this.renderer
                }
                return null
        },
        T.prototype.open = function(e) {
                S(e),
                E.prototype.open.call(this, e),
                this.state = P.READING,
                H(this, e)
        },
        k.prototype.open = A.prototype.open = function(e) {
                e.stack.top().addChild(this)
        },
        N.prototype.open = function(e) {
                E.prototype.open.call(this, e),
                (e.imp || e.target).blocks[this.name] = this
        },
        _.prototype.open = function(e) {
                var t = new D;
                t.open(e);
                var n = S(e, M);
                n.addChild(this),
                e.stack.push(this)
        },
        D.prototype.open = function(e) {
                var t = S(e, M);
                t.addChild(this),
                e.stack.push(this)
        },
        C.prototype.open = function(e) {
                this.parent = e.stack.top(),
                this.target = e.target,
                E.prototype.open.call(this, e),
                this.state = P.READING,
                e.imp = this
        },
        A.prototype.close = k.prototype.close = function() {},
        C.prototype.close = function(e) {
                E.prototype.close.call(this, e),
                this.state = P.READED,
                e.imp = null
        },
        T.prototype.close = function(e) {
                E.prototype.close.call(this, e),
                this.state = this.master ? P.READED: P.APPLIED,
                e.target = null
        },
        C.prototype.autoClose = function(e) {
                var t = this.parent.children;
                t.push.apply(t, this.children),
                this.children.length = 0;
                for (var n in this.blocks) this.target.blocks[n] = this.blocks[n];
                this.blocks = {},
                this.close(e)
        },
        A.prototype.beforeOpen = C.prototype.beforeOpen = k.prototype.beforeOpen = O.prototype.beforeOpen = L.prototype.beforeOpen = N.prototype.beforeOpen = M.prototype.beforeOpen = w.prototype.beforeAdd = function(e) {
                if (e.stack.bottom()) return;
                var t = new T(s(), e.engine);
                t.open(e)
        },
        C.prototype.getRendererBody = function() {
                return this.applyMaster(this.name),
                E.prototype.getRendererBody.call(this)
        },
        A.prototype.getRendererBody = function() {
                return h("{0}engine.render({2},{{3}}){1}", d, v, l(this.name), b(this.args, this.engine).replace(/(^|,)\s*([a-z0-9_]+)\s*=/ig,
                function(e, t, n) {
                        return (t || "") + l(n) + ":"
                }))
        },
        k.prototype.getRendererBody = function() {
                return this.expr ? h("v[{0}]={1};", l(this.name), b(this.expr, this.engine)) : ""
        },
        M.prototype.getRendererBody = function() {
                return h("if({0}){{1}}", b(this.value, this.engine), E.prototype.getRendererBody.call(this))
        },
        D.prototype.getRendererBody = function() {
                return h("}else{{0}", E.prototype.getRendererBody.call(this))
        },
        O.prototype.getRendererBody = function() {
                return h('var {0}={1};if({0} instanceof Array)for (var {4}=0,{5}={0}.length;{4}<{5};{4}++){v[{2}]={4};v[{3}]={0}[{4}];{6}}else if(typeof {0}==="object")for(var {4} in {0}){v[{2}]={4};v[{3}]={0}[{4}];{6}}', s(), b(this.list, this.engine), l(this.index || s()), l(this.item), s(), s(), E.prototype.getRendererBody.call(this))
        },
        L.prototype.getRendererBody = function() {
                var e = this.args;
                return h("{2}fs[{5}]((function(){{0}{4}{1}})(){6}){3}", p, m, d, v, E.prototype.getRendererBody.call(this), l(this.name), e ? "," + b(e, this.engine) : "")
        };
        var B = {};j("target", T), j("block", N), j("import", C), j("use", A), j("var", k), j("for", O), j("if", M), j("elif", _), j("else", D), j("filter", L), F.prototype.config = function(e) {
                t(this.options, e)
        },
        F.prototype.compile = F.prototype.parse = function(e) {
                if (e) {
                        var t = I(e, this);
                        if (t.length) return this.targets[t[0]].getRenderer()
                }
                return new Function('return ""')
        },
        F.prototype.getRenderer = function(e) {
                var t = this.targets[e];
                if (t) return t.getRenderer()
        },
        F.prototype.render = function(e, t) {
                var n = this.getRenderer(e);
                return n ? n(t) : ""
        },
        F.prototype.addFilter = function(e, t) {
                typeof t == "function" && (this.filters[e] = t)
        };
        var q = new F;
        q.Engine = F, 
        typeof exports == "object" && typeof module == "object" ? exports = module.exports = q: typeof r == "function" && r.amd ? r("etpl", q) : e.etpl = q
	} (this),
	function(e) {
		function st(e, t, r, i) {
                var s, o, a, l, c, h, v, y, b, x; (t ? t.ownerDocument || t: S) !== d && p(t),
                t = t || d,
                r = r || [],
                l = t.nodeType;
                if (typeof e != "string" || !e || l !== 1 && l !== 9 && l !== 11) return r;
	            if (!i && m) {
	                    if (l !== 11 && (s = Z.exec(e))) if (a = s[1]) {
	                            if (l === 9) {
	                                    o = t.getElementById(a);
	                                    if (!o || !o.parentNode) return r;
	                                    if (o.id === a) return r.push(o),
	                                    r
	                            } else if (t.ownerDocument && (o = t.ownerDocument.getElementById(a)) && w(t, o) && o.id === a) return r.push(o),
	                            r
	                    } else {
	                            if (s[2]) return P.apply(r, t.getElementsByTagName(e)),
	                            r;
	                            if ((a = s[3]) && n.getElementsByClassName) return P.apply(r, t.getElementsByClassName(a)),
	                            r
	                    }
	                    if (n.qsa && (!g || !g.test(e))) {
	                            y = v = E,
	                            b = t,
	                            x = l !== 1 && e;
	                            if (l === 1 && t.nodeName.toLowerCase() !== "object") {
	                                    h = u(e),
	                                    (v = t.getAttribute("id")) ? y = v.replace(tt, "\\$&") : t.setAttribute("id", y),
	                                    y = "[id='" + y + "'] ",
	                                    c = h.length;
	                                    while (c--) h[c] = y + mt(h[c]);
	                                    b = et.test(e) && dt(t.parentNode) || t,
	                                    x = h.join(",")
	                            }
	                            if (x) try {
	                                    return P.apply(r, b.querySelectorAll(x)),
	                                    r
	                            } catch(T) {} finally {
	                                    v || t.removeAttribute("id")
	                            }
	                    }
	            }
	            return f(e.replace(z, "$1"), t, r, i)
		}
	    function ot() {
	            function t(n, r) {
	                    return e.push(n + " ") > i.cacheLength && delete t[e.shift()],
	                    t[n + " "] = r
	            }
	            var e = [];
	            return t
	    }
	    function ut(e) {
	            return e[E] = !0,
	            e
	    }
	    function at(e) {
	            var t = d.createElement("div");
	            try {
	                    return !! e(t)
	            } catch(n) {
	                    return ! 1
	            } finally {
	                    t.parentNode && t.parentNode.removeChild(t),
	                    t = null
	            }
	    }
	    function ft(e, t) {
	            var n = e.split("|"),
	            r = e.length;
	            while (r--) i.attrHandle[n[r]] = t
	    }
	    function lt(e, t) {
	            var n = t && e,
	            r = n && e.nodeType === 1 && t.nodeType === 1 && (~t.sourceIndex || A) - (~e.sourceIndex || A);
	            if (r) return r;
	            if (n) while (n = n.nextSibling) if (n === t) return - 1;
	            return e ? 1 : -1
	    }
	    function ct(e) {
	            return function(t) {
	                    var n = t.nodeName.toLowerCase();
	                    return n === "input" && t.type === e
	            }
	    }
	    function ht(e) {
	            return function(t) {
	                    var n = t.nodeName.toLowerCase();
	                    return (n === "input" || n === "button") && t.type === e
	            }
	    }
	    function pt(e) {
	            return ut(function(t) {
	                    return t = +t,
	                    ut(function(n, r) {
	                            var i, s = e([], n.length, t),
	                            o = s.length;
	                            while (o--) n[i = s[o]] && (n[i] = !(r[i] = n[i]))
	                    })
	            })
	    }
	    function dt(e) {
	            return e && typeof e.getElementsByTagName != "undefined" && e
	    }
	    function vt() {}
	    function mt(e) {
	            var t = 0,
	            n = e.length,
	            r = "";
	            for (; t < n; t++) r += e[t].value;
	            return r
	    }
	    function gt(e, t, n) {
	            var r = t.dir,
	            i = n && r === "parentNode",
	            s = T++;
	            return t.first ?
	            function(t, n, s) {
	                    while (t = t[r]) if (t.nodeType === 1 || i) return e(t, n, s)
	            }: function(t, n, o) {
	                    var u, a, f = [x, s];
	                    if (o) {
	                            while (t = t[r]) if (t.nodeType === 1 || i) if (e(t, n, o)) return ! 0
	                    } else while (t = t[r]) if (t.nodeType === 1 || i) {
	                            a = t[E] || (t[E] = {});
	                            if ((u = a[r]) && u[0] === x && u[1] === s) return f[2] = u[2];
	                            a[r] = f;
	                            if (f[2] = e(t, n, o)) return ! 0
	                    }
	            }
	    }
        function yt(e) {
                return e.length > 1 ?
                function(t, n, r) {
                        var i = e.length;
                        while (i--) if (!e[i](t, n, r)) return ! 1;
                        return ! 0
                }: e[0]
        }
        function bt(e, t, n) {
                var r = 0,
                i = t.length;
                for (; r < i; r++) st(e, t[r], n);
                return n
        }
        function wt(e, t, n, r, i) {
                var s, o = [],
                u = 0,
                a = e.length,
                f = t != null;
                for (; u < a; u++) if (s = e[u]) if (!n || n(s, r, i)) o.push(s),
                f && t.push(u);
                return o
        }
        function Et(e, t, n, r, i, s) {
                return r && !r[E] && (r = Et(r)),
                i && !i[E] && (i = Et(i, s)),
                ut(function(s, o, u, a) {
                        var f, l, c, h = [],
                        p = [],
                        d = o.length,
                        v = s || bt(t || "*", u.nodeType ? [u] : u, []),
                        m = e && (s || !t) ? wt(v, h, e, u, a) : v,
                        g = n ? i || (s ? e: d || r) ? [] : o: m;
                        n && n(m, g, u, a);
                        if (r) {
                                f = wt(g, p),
                                r(f, [], u, a),
                                l = f.length;
                                while (l--) if (c = f[l]) g[p[l]] = !(m[p[l]] = c)
                        }
                        if (s) {
                                if (i || e) {
                                        if (i) {
                                                f = [],
                                                l = g.length;
                                                while (l--)(c = g[l]) && f.push(m[l] = c);
                                                i(null, g = [], f, a)
                                        }
                                        l = g.length;
                                        while (l--)(c = g[l]) && (f = i ? B(s, c) : h[l]) > -1 && (s[f] = !(o[f] = c))
                                }
                        } else g = wt(g === o ? g.splice(d, g.length) : g),
                        i ? i(null, o, g, a) : P.apply(o, g)
                })
        }
        function St(e) {
                var t, n, r, s = e.length,
                o = i.relative[e[0].type],
                u = o || i.relative[" "],
                a = o ? 1 : 0,
                f = gt(function(e) {
                        return e === t
                },
                u, !0),
                c = gt(function(e) {
                        return B(t, e) > -1
                },
                u, !0),
                h = [function(e, n, r) {
                        return ! o && (r || n !== l) || ((t = n).nodeType ? f(e, n, r) : c(e, n, r))
                }];
                for (; a < s; a++) if (n = i.relative[e[a].type]) h = [gt(yt(h), n)];
                else {
                        n = i.filter[e[a].type].apply(null, e[a].matches);
                        if (n[E]) {
                                r = ++a;
                                for (; r < s; r++) if (i.relative[e[r].type]) break;
                                return Et(a > 1 && yt(h), a > 1 && mt(e.slice(0, a - 1).concat({
                                        value: e[a - 2].type === " " ? "*": ""
                                })).replace(z, "$1"), n, a < r && St(e.slice(a, r)), r < s && St(e = e.slice(r)), r < s && mt(e))
                        }
                        h.push(n)
                }
                return yt(h)
        }
        function xt(e, t) {
                var n = t.length > 0,
                r = e.length > 0,
                s = function(s, o, u, a, f) {
                        var c, h, p, v = 0,
                        m = "0",
                        g = s && [],
                        y = [],
                        b = l,
                        w = s || r && i.find.TAG("*", f),
                        E = x += b == null ? 1 : Math.random() || .1,
                        S = w.length;
                        f && (l = o !== d && o);
                        for (; m !== S && (c = w[m]) != null; m++) {
                                if (r && c) {
                                        h = 0;
                                        while (p = e[h++]) if (p(c, o, u)) {
                                                a.push(c);
                                                break
                                        }
                                        f && (x = E)
                                }
                                n && ((c = !p && c) && v--, s && g.push(c))
                        }
                        v += m;
                        if (n && m !== v) {
                                h = 0;
                                while (p = t[h++]) p(g, y, o, u);
                                if (s) {
                                        if (v > 0) while (m--) ! g[m] && !y[m] && (y[m] = _.call(a));
                                        y = wt(y)
                                }
                                P.apply(a, y),
                                f && !s && y.length > 0 && v + t.length > 1 && st.uniqueSort(a)
                        }
                        return f && (x = E, l = b),
                        g
                };
                return n ? ut(s) : s
        }
        var t, n, i, s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E = "sizzle" + 1 * new Date,
        S = e.document,
        x = 0,
        T = 0,
        N = ot(),
        C = ot(),
        k = ot(),
        L = function(e, t) {
                return e === t && (h = !0),
                0
        },
        A = 1 << 31,
        O = {}.hasOwnProperty,
        M = [],
        _ = M.pop,
        D = M.push,
        P = M.push,
        H = M.slice,
        B = function(e, t) {
                var n = 0,
                r = e.length;
                for (; n < r; n++) if (e[n] === t) return n;
                return - 1
        },
        j = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
        F = "[\\x20\\t\\r\\n\\f]",
        I = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
        q = "\\[" + F + "*(" + I + ")(?:" + F + "*([*^$|!~]?=)" + F + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + I + "))|)" + F + "*\\]",
        R = ":(" + I + ")(?:\\((" + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + "((?:\\\\.|[^\\\\()[\\]]|" + q + ")*)|" + ".*" + ")\\)|)",
        U = new RegExp(F + "+", "g"),
        z = new RegExp("^" + F + "+|((?:^|[^\\\\])(?:\\\\.)*)" + F + "+$", "g"),
        W = new RegExp("^" + F + "*," + F + "*"),
        X = new RegExp("^" + F + "*([>+~]|" + F + ")" + F + "*"),
        V = new RegExp("=" + F + "*([^\\]'\"]*?)" + F + "*\\]", "g"),
        $ = new RegExp(R),
        J = new RegExp("^" + I + "$"),
        K = {
                ID: new RegExp("^#(" + I + ")"),
                CLASS: new RegExp("^\\.(" + I + ")"),
                TAG: new RegExp("^(" + I + "|[*])"),
                ATTR: new RegExp("^" + q),
                PSEUDO: new RegExp("^" + R),
                CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + F + "*(even|odd|(([+-]|)(\\d*)n|)" + F + "*(?:([+-]|)" + F + "*(\\d+)|))" + F + "*\\)|)", "i"),
                bool: new RegExp("^(?:" + j + ")$", "i"),
                needsContext: new RegExp("^" + F + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + F + "*((?:-\\d)?\\d*)" + F + "*\\)|)(?=[^-]|$)", "i")
        },
        Q = /^(?:input|select|textarea|button)$/i,
        G = /^h\d$/i,
        Y = /^[^{]+\{\s*\[native \w/,
        Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
        et = /[+~]/,
        tt = /'|\\/g,
        nt = new RegExp("\\\\([\\da-f]{1,6}" + F + "?|(" + F + ")|.)", "ig"),
        rt = function(e, t, n) {
                var r = "0x" + t - 65536;
                return r !== r || n ? t: r < 0 ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, r & 1023 | 56320)
        };
        try {
                P.apply(M = H.call(S.childNodes), S.childNodes),
                M[S.childNodes.length].nodeType
        } catch(it) {
                P = {
                        apply: M.length ?
                        function(e, t) {
                                D.apply(e, H.call(t))
                        }: function(e, t) {
                                var n = e.length,
                                r = 0;
                                while (e[n++] = t[r++]);
                                e.length = n - 1
                        }
                }
        }
        n = st.support = {},
        o = st.isXML = function(e) {
                var t = e && (e.ownerDocument || e).documentElement;
                return t ? t.nodeName !== "HTML": !1
        },
        p = st.setDocument = function(e) {
                var t, r = e ? e.ownerDocument || e: S,
                s = r.defaultView;
                if (r === d || r.nodeType !== 9 || !r.documentElement) return d;
                d = r,
                v = r.documentElement,
                m = !o(r),
                s && s !== s.top && (s.addEventListener ? s.addEventListener("unload",
                function() {
                        p()
                },
                !1) : s.attachEvent && s.attachEvent("onunload",
                function() {
                        p()
                })),
                n.attributes = at(function(e) {
                        return e.className = "i",
                        !e.getAttribute("className")
                }),
                n.getElementsByTagName = at(function(e) {
                        return e.appendChild(r.createComment("")),
                        !e.getElementsByTagName("*").length
                }),
                n.getElementsByClassName = Y.test(r.getElementsByClassName),
                n.getById = at(function(e) {
                        return v.appendChild(e).id = E,
                        !r.getElementsByName || !r.getElementsByName(E).length
                }),
                n.getById ? (i.find.ID = function(e, t) {
                        if (typeof t.getElementById != "undefined" && m) {
                                var n = t.getElementById(e);
                                return n && n.parentNode ? [n] : []
                        }
                },
                i.filter.ID = function(e) {
                        var t = e.replace(nt, rt);
                        return function(e) {
                                return e.getAttribute("id") === t
                        }
                }) : (delete i.find.ID, i.filter.ID = function(e) {
                        var t = e.replace(nt, rt);
                        return function(e) {
                                var n = typeof e.getAttributeNode != "undefined" && e.getAttributeNode("id");
                                return n && n.value === t
                        }
                }),
                i.find.TAG = n.getElementsByTagName ?
                function(e, t) {
                        if (typeof t.getElementsByTagName != "undefined") return t.getElementsByTagName(e);
                        if (n.qsa) return t.querySelectorAll(e)
                }: function(e, t) {
                        var n, r = [],
                        i = 0,
                        s = t.getElementsByTagName(e);
                        if (e === "*") {
                                while (n = s[i++]) n.nodeType === 1 && r.push(n);
                                return r
                        }
                        return s
                },
                i.find.CLASS = n.getElementsByClassName &&
                function(e, t) {
                        if (m) return t.getElementsByClassName(e)
                },
                y = [],
                g = [];
                if (n.qsa = Y.test(r.querySelectorAll)) at(function(e) {
                        e.innerHTML = "<select msallowcapture=''><option id='d\f]' selected=''></option></select>",
                        e.querySelectorAll("[msallowcapture^='']").length && g.push("[*^$]=" + F + "*(?:''|\"\")"),
                        e.querySelectorAll("[selected]").length || g.push("\\[" + F + "*(?:value|" + j + ")"),
                        e.querySelectorAll("[id~=d]").length || g.push("~="),
                        e.querySelectorAll(":checked").length || g.push(":checked")
                }),
                at(function(e) {
                        var t = r.createElement("input");
                        t.setAttribute("type", "hidden"),
                        e.appendChild(t).setAttribute("name", "D"),
                        e.querySelectorAll("[name=d]").length && g.push("name" + F + "*[*^$|!~]?="),
                        e.querySelectorAll(":enabled").length || g.push(":enabled", ":disabled"),
                        e.querySelectorAll("*,:x"),
                        g.push(",.*:")
                });
                return (n.matchesSelector = Y.test(b = v.matches || v.webkitMatchesSelector || v.mozMatchesSelector || v.oMatchesSelector || v.msMatchesSelector)) && at(function(e) {
                        n.disconnectedMatch = b.call(e, "div"),
                        b.call(e, "[s!='']:x"),
                        y.push("!=", R)
                }),
                g = g.length && new RegExp(g.join("|")),
                y = y.length && new RegExp(y.join("|")),
                t = Y.test(v.compareDocumentPosition),
                w = t || Y.test(v.contains) ?
                function(e, t) {
                        var n = e.nodeType === 9 ? e.documentElement: e,
                        r = t && t.parentNode;
                        return e === r || !!r && r.nodeType === 1 && !!(n.contains ? n.contains(r) : e.compareDocumentPosition && e.compareDocumentPosition(r) & 16)
                }: function(e, t) {
                        if (t) while (t = t.parentNode) if (t === e) return ! 0;
                        return ! 1
                },
                L = t ?
                function(e, t) {
                        if (e === t) return h = !0,
                        0;
                        var i = !e.compareDocumentPosition - !t.compareDocumentPosition;
                        return i ? i: (i = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1, i & 1 || !n.sortDetached && t.compareDocumentPosition(e) === i ? e === r || e.ownerDocument === S && w(S, e) ? -1 : t === r || t.ownerDocument === S && w(S, t) ? 1 : c ? B(c, e) - B(c, t) : 0 : i & 4 ? -1 : 1)
                }: function(e, t) {
                        if (e === t) return h = !0,
                        0;
                        var n, i = 0,
                        s = e.parentNode,
                        o = t.parentNode,
                        u = [e],
                        a = [t];
                        if (!s || !o) return e === r ? -1 : t === r ? 1 : s ? -1 : o ? 1 : c ? B(c, e) - B(c, t) : 0;
                        if (s === o) return lt(e, t);
                        n = e;
                        while (n = n.parentNode) u.unshift(n);
                        n = t;
                        while (n = n.parentNode) a.unshift(n);
                        while (u[i] === a[i]) i++;
                        return i ? lt(u[i], a[i]) : u[i] === S ? -1 : a[i] === S ? 1 : 0
                },
                r
        },
        st.matches = function(e, t) {
                return st(e, null, null, t)
        },
        st.matchesSelector = function(e, t) { (e.ownerDocument || e) !== d && p(e),
                t = t.replace(V, "='$1']");
                if (n.matchesSelector && m && (!y || !y.test(t)) && (!g || !g.test(t))) try {
                        var r = b.call(e, t);
                        if (r || n.disconnectedMatch || e.document && e.document.nodeType !== 11) return r
                } catch(i) {}
                return st(t, d, null, [e]).length > 0
        },
        st.contains = function(e, t) {
                return (e.ownerDocument || e) !== d && p(e),
                w(e, t)
        },
        st.attr = function(e, t) { (e.ownerDocument || e) !== d && p(e);
                var r = i.attrHandle[t.toLowerCase()],
                s = r && O.call(i.attrHandle, t.toLowerCase()) ? r(e, t, !m) : undefined;
                return s !== undefined ? s: n.attributes || !m ? e.getAttribute(t) : (s = e.getAttributeNode(t)) && s.specified ? s.value: null
        },
        st.error = function(e) {
                throw new Error("Syntax error, unrecognized expression: " + e)
        },
        st.uniqueSort = function(e) {
                var t, r = [],
                i = 0,
                s = 0;
                h = !n.detectDuplicates,
                c = !n.sortStable && e.slice(0),
                e.sort(L);
                if (h) {
                        while (t = e[s++]) t === e[s] && (i = r.push(s));
                        while (i--) e.splice(r[i], 1)
                }
                return c = null,
                e
        },
        s = st.getText = function(e) {
                var t, n = "",
                r = 0,
                i = e.nodeType;
                if (!i) while (t = e[r++]) n += s(t);
                else if (i === 1 || i === 9 || i === 11) {
                        if (typeof e.textContent == "string") return e.textContent;
                        for (e = e.firstChild; e; e = e.nextSibling) n += s(e)
                } else if (i === 3 || i === 4) return e.nodeValue;
                return n
        },
        i = st.selectors = {
                cacheLength: 50,
                createPseudo: ut,
                match: K,
                attrHandle: {},
                find: {},
                relative: {
                        ">": {
                                dir: "parentNode",
                                first: !0
                        },
                        " ": {
                                dir: "parentNode"
                        },
                        "+": {
                                dir: "previousSibling",
                                first: !0
                        },
                        "~": {
                                dir: "previousSibling"
                        }
                },
                preFilter: {
                        ATTR: function(e) {
                                return e[1] = e[1].replace(nt, rt),
                                e[3] = (e[3] || e[4] || e[5] || "").replace(nt, rt),
                                e[2] === "~=" && (e[3] = " " + e[3] + " "),
                                e.slice(0, 4)
                        },
                        CHILD: function(e) {
                                return e[1] = e[1].toLowerCase(),
                                e[1].slice(0, 3) === "nth" ? (e[3] || st.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * (e[3] === "even" || e[3] === "odd")), e[5] = +(e[7] + e[8] || e[3] === "odd")) : e[3] && st.error(e[0]),
                                e
                        },
                        PSEUDO: function(e) {
                                var t, n = !e[6] && e[2];
                                return K.CHILD.test(e[0]) ? null: (e[3] ? e[2] = e[4] || e[5] || "": n && $.test(n) && (t = u(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3))
                        }
                },
                filter: {
                        TAG: function(e) {
                                var t = e.replace(nt, rt).toLowerCase();
                                return e === "*" ?
                                function() {
                                        return ! 0
                                }: function(e) {
                                        return e.nodeName && e.nodeName.toLowerCase() === t
                                }
                        },
                        CLASS: function(e) {
                                var t = N[e + " "];
                                return t || (t = new RegExp("(^|" + F + ")" + e + "(" + F + "|$)")) && N(e,
                                function(e) {
                                        return t.test(typeof e.className == "string" && e.className || typeof e.getAttribute != "undefined" && e.getAttribute("class") || "")
                                })
                        },
                        ATTR: function(e, t, n) {
                                return function(r) {
                                        var i = st.attr(r, e);
                                        return i == null ? t === "!=": t ? (i += "", t === "=" ? i === n: t === "!=" ? i !== n: t === "^=" ? n && i.indexOf(n) === 0 : t === "*=" ? n && i.indexOf(n) > -1 : t === "$=" ? n && i.slice( - n.length) === n: t === "~=" ? (" " + i.replace(U, " ") + " ").indexOf(n) > -1 : t === "|=" ? i === n || i.slice(0, n.length + 1) === n + "-": !1) : !0
                                }
                        },
                        CHILD: function(e, t, n, r, i) {
                                var s = e.slice(0, 3) !== "nth",
                                o = e.slice( - 4) !== "last",
                                u = t === "of-type";
                                return r === 1 && i === 0 ?
                                function(e) {
                                        return !! e.parentNode
                                }: function(t, n, a) {
                                        var f, l, c, h, p, d, v = s !== o ? "nextSibling": "previousSibling",
                                        m = t.parentNode,
                                        g = u && t.nodeName.toLowerCase(),
                                        y = !a && !u;
                                        if (m) {
                                                if (s) {
                                                        while (v) {
                                                                c = t;
                                                                while (c = c[v]) if (u ? c.nodeName.toLowerCase() === g: c.nodeType === 1) return ! 1;
                                                                d = v = e === "only" && !d && "nextSibling"
                                                        }
                                                        return ! 0
                                                }
                                                d = [o ? m.firstChild: m.lastChild];
                                                if (o && y) {
                                                        l = m[E] || (m[E] = {}),
                                                        f = l[e] || [],
                                                        p = f[0] === x && f[1],
                                                        h = f[0] === x && f[2],
                                                        c = p && m.childNodes[p];
                                                        while (c = ++p && c && c[v] || (h = p = 0) || d.pop()) if (c.nodeType === 1 && ++h && c === t) {
                                                                l[e] = [x, p, h];
                                                                break
                                                        }
                                                } else if (y && (f = (t[E] || (t[E] = {}))[e]) && f[0] === x) h = f[1];
                                                else while (c = ++p && c && c[v] || (h = p = 0) || d.pop()) if ((u ? c.nodeName.toLowerCase() === g: c.nodeType === 1) && ++h) {
                                                        y && ((c[E] || (c[E] = {}))[e] = [x, h]);
                                                        if (c === t) break
                                                }
                                                return h -= i,
                                                h === r || h % r === 0 && h / r >= 0
                                        }
                                }
                        },
                        PSEUDO: function(e, t) {
                                var n, r = i.pseudos[e] || i.setFilters[e.toLowerCase()] || st.error("unsupported pseudo: " + e);
                                return r[E] ? r(t) : r.length > 1 ? (n = [e, e, "", t], i.setFilters.hasOwnProperty(e.toLowerCase()) ? ut(function(e, n) {
                                        var i, s = r(e, t),
                                        o = s.length;
                                        while (o--) i = B(e, s[o]),
                                        e[i] = !(n[i] = s[o])
                                }) : function(e) {
                                        return r(e, 0, n)
                                }) : r
                        }
                },
                pseudos: {
                        not: ut(function(e) {
                                var t = [],
                                n = [],
                                r = a(e.replace(z, "$1"));
                                return r[E] ? ut(function(e, t, n, i) {
                                        var s, o = r(e, null, i, []),
                                        u = e.length;
                                        while (u--) if (s = o[u]) e[u] = !(t[u] = s)
                                }) : function(e, i, s) {
                                        return t[0] = e,
                                        r(t, null, s, n),
                                        !n.pop()
                                }
                        }),
                        has: ut(function(e) {
                                return function(t) {
                                        return st(e, t).length > 0
                                }
                        }),
                        contains: ut(function(e) {
                                return e = e.replace(nt, rt),
                                function(t) {
                                        return (t.textContent || t.innerText || s(t)).indexOf(e) > -1
                                }
                        }),
                        lang: ut(function(e) {
                                return J.test(e || "") || st.error("unsupported lang: " + e),
                                e = e.replace(nt, rt).toLowerCase(),
                                function(t) {
                                        var n;
                                        do
                                        if (n = m ? t.lang: t.getAttribute("xml:lang") || t.getAttribute("lang")) return n = n.toLowerCase(),
                                        n === e || n.indexOf(e + "-") === 0;
                                        while ((t = t.parentNode) && t.nodeType === 1);
                                        return ! 1
                                }
                        }),
                        target: function(t) {
                                var n = e.location && e.location.hash;
                                return n && n.slice(1) === t.id
                        },
                        root: function(e) {
                                return e === v
                        },
                        focus: function(e) {
                                return e === d.activeElement && (!d.hasFocus || d.hasFocus()) && !!(e.type || e.href || ~e.tabIndex)
                        },
                        enabled: function(e) {
                                return e.disabled === !1
                        },
                        disabled: function(e) {
                                return e.disabled === !0
                        },
                        checked: function(e) {
                                var t = e.nodeName.toLowerCase();
                                return t === "input" && !!e.checked || t === "option" && !!e.selected
                        },
                        selected: function(e) {
                                return e.parentNode && e.parentNode.selectedIndex,
                                e.selected === !0
                        },
                        empty: function(e) {
                                for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeType < 6) return ! 1;
                                return ! 0
                        },
                        parent: function(e) {
                                return ! i.pseudos.empty(e)
                        },
                        header: function(e) {
                                return G.test(e.nodeName)
                        },
                        input: function(e) {
                                return Q.test(e.nodeName)
                        },
                        button: function(e) {
                                var t = e.nodeName.toLowerCase();
                                return t === "input" && e.type === "button" || t === "button"
                        },
                        text: function(e) {
                                var t;
                                return e.nodeName.toLowerCase() === "input" && e.type === "text" && ((t = e.getAttribute("type")) == null || t.toLowerCase() === "text")
                        },
                        first: pt(function() {
                                return [0]
                        }),
                        last: pt(function(e, t) {
                                return [t - 1]
                        }),
                        eq: pt(function(e, t, n) {
                                return [n < 0 ? n + t: n]
                        }),
                        even: pt(function(e, t) {
                                var n = 0;
                                for (; n < t; n += 2) e.push(n);
                                return e
                        }),
                        odd: pt(function(e, t) {
                                var n = 1;
                                for (; n < t; n += 2) e.push(n);
                                return e
                        }),
                        lt: pt(function(e, t, n) {
                                var r = n < 0 ? n + t: n;
                                for (; --r >= 0;) e.push(r);
                                return e
                        }),
                        gt: pt(function(e, t, n) {
                                var r = n < 0 ? n + t: n;
                                for (; ++r < t;) e.push(r);
                                return e
                        })
                }
        },
        i.pseudos.nth = i.pseudos.eq;
        for (t in {
                radio: !0,
                checkbox: !0,
                file: !0,
                password: !0,
                image: !0
        }) i.pseudos[t] = ct(t);
        for (t in {
                submit: !0,
                reset: !0
        }) i.pseudos[t] = ht(t);
        vt.prototype = i.filters = i.pseudos,
        i.setFilters = new vt,
        u = st.tokenize = function(e, t) {
                var n, r, s, o, u, a, f, l = C[e + " "];
                if (l) return t ? 0 : l.slice(0);
                u = e,
                a = [],
                f = i.preFilter;
                while (u) {
                        if (!n || (r = W.exec(u))) r && (u = u.slice(r[0].length) || u),
                        a.push(s = []);
                        n = !1;
                        if (r = X.exec(u)) n = r.shift(),
                        s.push({
                                value: n,
                                type: r[0].replace(z, " ")
                        }),
                        u = u.slice(n.length);
                        for (o in i.filter)(r = K[o].exec(u)) && (!f[o] || (r = f[o](r))) && (n = r.shift(), s.push({
                                value: n,
                                type: o,
                                matches: r
                        }), u = u.slice(n.length));
                        if (!n) break
                }
                return t ? u.length: u ? st.error(e) : C(e, a).slice(0)
        },
        a = st.compile = function(e, t) {
                var n, r = [],
                i = [],
                s = k[e + " "];
                if (!s) {
                        t || (t = u(e)),
                        n = t.length;
                        while (n--) s = St(t[n]),
                        s[E] ? r.push(s) : i.push(s);
                        s = k(e, xt(i, r)),
                        s.selector = e
                }
                return s
        },
        f = st.select = function(e, t, r, s) {
                var o, f, l, c, h, p = typeof e == "function" && e,
                d = !s && u(e = p.selector || e);
                r = r || [];
                if (d.length === 1) {
                        f = d[0] = d[0].slice(0);
                        if (f.length > 2 && (l = f[0]).type === "ID" && n.getById && t.nodeType === 9 && m && i.relative[f[1].type]) {
                                t = (i.find.ID(l.matches[0].replace(nt, rt), t) || [])[0];
                                if (!t) return r;
                                p && (t = t.parentNode),
                                e = e.slice(f.shift().value.length)
                        }
                        o = K.needsContext.test(e) ? 0 : f.length;
                        while (o--) {
                                l = f[o];
                                if (i.relative[c = l.type]) break;
                                if (h = i.find[c]) if (s = h(l.matches[0].replace(nt, rt), et.test(f[0].type) && dt(t.parentNode) || t)) {
                                        f.splice(o, 1),
                                        e = s.length && mt(f);
                                        if (!e) return P.apply(r, s),
                                        r;
                                        break
                                }
                        }
                }
                return (p || a(e, d))(s, t, !m, r, et.test(e) && dt(t.parentNode) || t),
                r
        },
        n.sortStable = E.split("").sort(L).join("") === E,
        n.detectDuplicates = !!h,
        p(),
        n.sortDetached = at(function(e) {
                return e.compareDocumentPosition(d.createElement("div")) & 1
        }),
        at(function(e) {
                return e.innerHTML = "<a href='#'></a>",
                e.firstChild.getAttribute("href") === "#"
        }) || ft("type|href|height|width",
        function(e, t, n) {
                if (!n) return e.getAttribute(t, t.toLowerCase() === "type" ? 1 : 2)
        }),
        (!n.attributes || !at(function(e) {
                return e.innerHTML = "<input/>",
                e.firstChild.setAttribute("value", ""),
                e.firstChild.getAttribute("value") === ""
        })) && ft("value",
        function(e, t, n) {
                if (!n && e.nodeName.toLowerCase() === "input") return e.defaultValue
        }),
        at(function(e) {
                return e.getAttribute("disabled") == null
        }) || ft(j,
        function(e, t, n) {
                var r;
                if (!n) return e[t] === !0 ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value: null
        }),
        typeof r == "function" && r.amd ? r("Sizzle", [],
        function() {
                return st
        }) : typeof module != "undefined" && module.exports ? module.exports = st: e.Sizzle = st
    } (window), 
            
    r("bkgraph/component/SideBar", ["require", "./Component", "zrender/tool/util", "etpl", "Sizzle", "../util/util", "../util/log"],
    function(e) {
            var t = e("./Component"),
            n = e("zrender/tool/util"),
            r = e("etpl"),
            i = e("Sizzle"),
            s = e("../util/util"),
            o = e("../util/log"),
            f = function() {
                    t.call(this),
                    this._scrollbar = null,
                    this._isFold = !0;
                    var e = this;
                    s.addEventListener(this.el, "click",function(t) {
                        e._dispatchClick(t)
                    }),
                    s.addEventListener(this.el, "mouseenter",function(t) {
                        o({
                            type: "zhishitupuhover",
                            target: e._logParam,
                            area: "sidebar"
                        })
                    })
            };
            return f.prototype.type = "SIDEBAR",
            f.prototype.initialize = function(e, t) {
                    return this.el.className = "bkg-sidebar hidden",
                    this._$wrapper = document.createElement("div"),
                    this._$wrapper.className = "bkg-sidebar-wrapper",
                    this.el.appendChild(this._$wrapper),
                    this._$closeBtn = document.createElement("div"),
                    this._$closeBtn.className = "bkg-sidebar-close",
                    this.el.appendChild(this._$closeBtn),
                    this._kgraph = e,
                    this.el
            },
            f.prototype.resize = function(e, t) {
                    //var n = t - this._$intro.clientHeight - 100;
                    /*var n = t - 100;
                    r = this._$viewport.clientHeight,
                    i = this._$content.clientHeight;
                    this._scrollbar ? i < n ? (this._$viewport.style.height = i + "px", this.el.style.height = this._$intro.clientHeight + i + "px") : (this._$viewport.style.height = n + "px", this.el.style.height = t - 100 + "px") : r > n && this._forScroll(),
                    this._scrollbar && this._scrollbar.resize()*/
            },
            f.prototype.setData = function(e, t) {
                    this._scrollbar && (this._scrollbar = null),
                    this._fixData(e, t)
            },
            f.prototype._fixData = function(e, t) {
                    if (e._isfixed) return;
                    if (t && e.eventMaiLuo) {
                            var n = 0;
                            for (var r = 0,
                            i = e.eventMaiLuo.length; r < i; r++) {
                                    var s = e.eventMaiLuo[r],
                                    o = s.publishTime,
                                    u = o.substring(0, o.indexOf("-"));
                                    s.publishTime = o.substring(o.indexOf("-") + 1, o.length),
                                    n != u && (n = u, s.year = u)
                            }
                    }
                    var a = linenum = 0,
                    f = -1,
                    l = {},
                    c, h = e.singleTag || e.pairTag;
                    if (h) {
                            for (var r = 0,
                            i = h.length; r < i; r++) {
                                    c = h[r],
                                    a < 9 ? a += c.text.length: (linenum++, a = c.text.length),
                                    c.linenum = linenum,
                                    l[linenum] = a;
                                    if (linenum >= 3) break
                            }
                            for (var r = 0,
                            i = h.length; r < i; r++) {
                                    c = h[r],
                                    c.linenum < 3 && (c.width = Math.floor(c.text.length * 298 / l[c.linenum]) + "px"),
                                    c.linenum != f && (c.cls = " no-left-border ");
                                    if (c.linenum == 2 || linenum == c.linenum) c.cls = (c.cls || "") + " no-bottom-border";
                                    f = c.linenum
                            }
                    }
                    if (t && e.recommendation) {
                            h = e.recommendation.content,
                            a = linenum = 0,
                            f = -1;
                            for (var r = 0,
                            i = h.length; r < i; r++) {
                                    c = h[r],
                                    a < 12 ? a += (c.fromName.length > 6 ? 6 : c.fromName.length) + (c.toName.length > 6 ? 6 : c.toName.length) + 1 : (linenum++, a = (c.fromName.length > 6 ? 6 : c.fromName.length) + (c.toName.length > 6 ? 6 : c.toName.length) + 1),
                                    c.linenum = linenum,
                                    l[linenum] = a;
                                    if (linenum >= 3) break
                            }
                            for (var r = 0,
                            i = h.length; r < i; r++) {
                                    c = h[r],
                                    c.linenum < 3 && (c.width = Math.floor(((c.fromName.length > 6 ? 6 : c.fromName.length) + (c.toName.length > 6 ? 6 : c.toName.length) + 1) * 298 / l[c.linenum]) + "px"),
                                    c.linenum != f && (c.cls = " no-left-border ");
                                    if (c.linenum == 2 || linenum == c.linenum) c.cls = (c.cls || "") + " no-bottom-border";
                                    f = c.linenum
                            }
                    }
                    e._isfixed = !0
            },
            /*详细信息展示*/
            f.prototype.show = function(e) {
            	o({
                    type: "zhishitupushow",
                    target: e,
                    area: "sidebar"
            	})
            	if(e.id){
            		var str ="";
            		str+='<div class="bkg-person-info">';
            		str+='<div class="personInfo_top">';
            		str+='<a class="bkg-person-pic bkg-hoverable fl" data-area="entity-baike-pic" title="'+e.data.name+'">';
            		str+='<img src="'+e.data.image+'" crossorigin="anonymous"/>';
            		str+='</a>';
            		str+='<ul class="fl" style="margin-left: 10px; margin-top: 10px;">';
            		str+='<li style="text-align: left;">';
            		str+='<span class="bkg-person-name">'+e.data.name+'</span>';
            		str+='</li>';
            		str+='<li style="margin-top: 6px;text-align: left;">';
            		str+='<span class="bkg-person-name2">'+e.data.degree+'</span>';
            		str+='</li>';
            		str+='<li style="margin-top: 6px;text-align: left;">';
            		str+='<span class="bkg-person-name2">'+e.data.political+'</span>';
            		str+='</li>';
            		str+='</ul></div>';
            		str+='<div class="personInfo_mid"></div>';
            		str+='<div class="personInfo_bom">';
            		str+='<ul>';
            		str+='<li>性别：<span>'+e.data.sexu+'</span></li>';
            		str+='<li>出生年月：<span>'+e.data.birday+'</span></li>';
            		str+='<li>单位：<span>'+e.data.buiness+'</span></li>';
            		str+='</ul>';
            		str+='</div>';
            		str+='</div>';
            	}else{
            		var str ="";
            		str+='<div class="bkg-relation-info">';
            		str+='<div class="bkg-relation-entity-wrapper">';
            		str+='<div class="bkg-relation-entity">';
            		str+='<div class="bkg-relation-entity-from">';
            		str+='<a data-area="relation-info-entity" class="bkg-hoverable" title="'+e.node1.data.name+'">';
            		str+='<img src="'+e.node1.data.image+'" crossorigin="anonymous"/>';
            		str+='<h5>'+e.node1.data.name+'</h5>';
            		str+='</a>';
            		str+='</div>';
            		str+='<div class="bkg-relation-name">';
            		str+='<a data-area="relation-info-title">';
            		str+='<span style="top: -10px;">'+e.data.relationName+'</span>';
            		str+='</a>';
            		str+='</div>';
            		str+='<div class="bkg-relation-entity-to">';
            		str+='<a data-area="relation-info-entity" class="bkg-hoverable" title="'+e.node2.data.name+'">';
            		str+='<img src="'+e.node2.data.image+'" crossorigin="anonymous"/>';
            		str+='<h5>'+e.node2.data.name+'</h5>';
            		str+='</a>';
            		str+='</div>';
            		str+='</div>';
            		str+='</div>';
            		str+='</div>';
            	}
            	$("#detailInfo")[0].innerHTML = str;
        		$("#bkg-sidebar").css('display','block');
            },
            f.prototype.hide = function(e, t) {
                    if (!s.hasClass(this.el, "hidden")) {
                            this.el.style.height = 0;
                            var n = this;
                            setTimeout(function() {
                                    s.addClass(n.el, "hidden"),
                                    t && t()
                            },
                            150),
                            o({
                                    type: "zhishitupuhide",
                                    target: e,
                                    area: "sidebar"
                            })
                    }
            },
            f.prototype.toggle = function(e) {
                    s.hasClass(this.el, "hidden") ? this.show(e) : this.hide(e)
            },
            f.prototype.fold = function(e) {
                    s.hasClass(this._$fold, "bkg-hidden") || (s.removeClass(this._$toggle, "bkg-toggle-fold"), s.addClass(this._$fold, "bkg-hidden"), this._isFold = !0, this._forScroll(), o({
                            type: "zhishitupufold",
                            target: e,
                            area: "sidebar"
                    }))
            },
            f.prototype.unfold = function(e) {
                    s.hasClass(this._$fold, "bkg-hidden") && (s.addClass(this._$toggle, "bkg-toggle-fold"), s.removeClass(this._$fold, "bkg-hidden"), this._isFold = !1, this._forScroll(), o({
                            type: "zhishitupuunfold",
                            target: e,
                            area: "sidebar"
                    }))
            },
            f.prototype._forScroll = function() {
                    var e = document.body.clientHeight - this._$intro.clientHeight - 100,
                    t = this._$viewport.clientHeight,
                    n = this._$content.clientHeight;
                    this._isFold ? (this._scrollbar && (this._scrollbar.scrollTo(0), this._$viewport.style.height && (this._$viewport.style.height = this._$content.clientHeight + "px", this._scrollbar.destory(), this._scrollbar = null)), this.el.style.height = this._$intro.clientHeight + this._$content.clientHeight + "px") : this._$content.clientHeight > e ? (this._$viewport.style.height = e + "px", this._scrollbar || (this._scrollbar = new u(this._$content)), this._scrollbar.scrollTo(0), this._scrollbar.resize(), this.el.style.height = document.body.clientHeight - 100 + "px") : (this._$viewport.style.height = this._$content.clientHeight + "px", this.el.style.height = this._$intro.clientHeight + this._$content.clientHeight + "px")
            },
            f.prototype.toggleFold = function(e) {
                    s.hasClass(this._$fold, "bkg-hidden") ? this.unfold(e) : this.fold(e)
            },
            f.prototype._dispatchClick = function(e) {
                    var t = e.target || e.srcElement;
                    i.matchesSelector(t, ".bkg-sidebar-close") && this.toggle(this._logParam),
                    (i.matchesSelector(t, ".bkg-toggle") || i.matchesSelector(t, ".bkg-toggle-btn")) && this.toggleFold(this._logParam);
                    var n = t;
                    while (n && n.nodeName.toLowerCase() !== "a") n = n.parentNode;
                    if (n) {
                            var r = n.getAttribute("data-area");
                            o({
                                    type: "zhishitupulink",
                                    target: [this._logParam, n.getAttribute("title"), n.getAttribute("href")].join(","),
                                    area: "sidebar-" + r
                            })
                    }
            },
            n.inherits(f, t),
            f
    }), 
    r("bkgraph/component/Loading", ["require", "./Component", "zrender/tool/util", "../util/util"],
    function(e) {
            var t = e("./Component"),
            n = e("zrender/tool/util"),
            r = e("../util/util"),
            i = function() {
                    t.call(this),
                    this._frameNumber = 2,
                    this._currentFrame = 0,
                    this._frameWidth = 180
            };
            return i.prototype.type = "LOADING",
            i.prototype.initialize = function(e, t) {
                    this._kgraph = e,
                    this.el.className = "bkg-loading",
                    this._$animationEl = document.createElement("div"),
                    this._$animationEl.className = "bkg-loading-animation";
                    var n = document.createElement("div");
                    n.className = "bkg-loading-tip",
                    n.innerHTML = "努力加载中",
                    this.el.appendChild(this._$animationEl),
                    this._$animationEl.appendChild(n);
                    var r = this;
                    this._interval = setInterval(function() {
                            r._animationFrame()
                    },
                    500)
            },
            i.prototype._animationFrame = function() {
                    this._currentFrame = (this._currentFrame + 1) % this._frameNumber;
                    var e = this._frameWidth * this._currentFrame;
                    this._$animationEl.style.backgroundPosition = -e + "px 0px"
            },
            i.prototype.dispose = function() {
                    clearInterval(this._interval)
            },
            n.inherits(i, t),
            i
    }),
    r("bkgraph/component/Tip", ["require", "./Component", "zrender/tool/util", "etpl", "Sizzle", "../util/util", "../util/log"],
    function(e) {
            var t = e("./Component"),
            n = e("zrender/tool/util"),
            r = e("etpl"),
            i = e("Sizzle"),
            s = e("../util/util"),
            o = e("../util/log"),
            u = function() {
                    t.call(this),
                    this._isMouseenter = !1,
                    this._direction = "left";
                    var e = this
            };
            return u.prototype.type = "TIP",
            u.prototype.initialize = function(e, t) {
                    return this._kgraph = e,
                    this.el.className = "bkg-tip-wrapper hidden",
                    this._$arrow = document.createElement("div"),
                    this._$tip = document.createElement("div"),
                    this._$tip.className = "bkg-tip",
                    this._$content = document.createElement("div"),
                    this._$content.className = "bkg-tip-content",
                    this._$tip.appendChild(this._$content),
                    this.el.appendChild(this._$arrow),
                    this.el.appendChild(this._$tip),
                    this.el
            },
            u.prototype.setData = function(e, t, n, r) {
                    this.render(e, t, n, r)
            },
            u.prototype.render = function(e, t, n, r) {
                    this._direction = this._getDirection(t, n),
                    e.arrowType = this._direction,
                    this._$arrow.className = "bkg-tip-arrow " + this._direction,
                    this._$content.innerHTML = e,
                    this._setPosition(this._direction, t, n),
                    this.show(),
                    r && r()
            },
            u.prototype._getDirection = function(e, t) {
                    var n = e.entity.el.position,
                    r = n[0],
                    i = n[1];
                    t && (r = e.entity.getShape("labelLine").style.cx, i = e.entity.getShape("labelLine").style.cy);
                    var s = this._kgraph.getComponentByType("GRAPH"),
                    o = s.getZR(),
                    u = o.painter.getLayer(0);
                    r += u.position[0],
                    i += u.position[1];
                    var a = u.__zoom || 1;
                    r *= a,
                    i *= a;
                    var f = document.body.clientWidth,
                    l = document.body.clientHeight,
                    c = this._direction;
                    return r > f * .75 ? (c = "right", i > l * .85 && (c = "bottom"), i < l * .15 && (c = "top")) : (i > l * .85 && (c = "bottom"), i < l * .15 && (c = "top")),
                    c
            },
            /*yyh*/
            u.prototype._setPosition = function(e, t, n) {
                    var r = t.entity.el.position,
                    i = r[0],
                    o = r[1];
                    n && (i = t.entity.getShape("labelLine").style.cx, o = t.entity.getShape("labelLine").style.cy);
                    var u = this._kgraph.getComponentByType("GRAPH"),
                    a = u.getZR(),
                    f = a.painter.getLayer(0),
                    l = f.__zoom || 1;
                    i *= l,
                    o *= l,
                    i += f.position[0],
                    o += f.position[1];
                    var c = s.getStyle(this.el);
                    switch (e) {
                    case "top":
                            i -= parseInt(c.width) / 2 + parseInt(c.paddingLeft),
                            n ? o += t.entity.getShape("labelLine").style.r: o += (parseInt(c.paddingBottom) + 10) * l;
                            break;
                    case "right":
                            o -= parseInt(c.height) / 2 + parseInt(c.paddingTop),
                            n ? i -= parseInt(c.width) + t.entity.getShape("labelLine").style.r * 1.5 : i -= parseInt(c.width) + t.entity.radius + 10,
                            i -= parseInt(c.paddingLeft) + 15;
                            break;
                    case "bottom":
                            i -= parseInt(c.width) / 2 + parseInt(c.paddingLeft),
                            n ? o -= parseInt(c.height) + t.entity.getShape("labelLine").style.r * 2 : o -= parseInt(c.height) + t.entity.radius + 10,
                            o -= parseInt(c.paddingBottom) * l + 15;
                            break;
                    case "left":
                            o -= parseInt(c.height) / 2 + parseInt(c.paddingLeft),
                            n ? i += t.entity.getShape("labelLine").style.r * 1.5 * l: i += t.entity.radius * l + 10,
                            i -= (parseInt(c.paddingLeft) - 15) * l
                    }
                    this.el.style.left = i + "px",
                    this.el.style.top = o + "px"
            },
            u.prototype.show = function() {
                    s.hasClass(this.el, "hidden") && (s.removeClass(this.el, "hidden"), o({
                            type: "zhishitupushow",
                            target: this._logParam,
                            area: "tip"
                    }))
            },
            u.prototype.hide = function() { ! s.hasClass(this.el, "hidden") && !this._isMouseenter && (s.addClass(this.el, "hidden"), o({
                            type: "zhishitupuhide",
                            target: this._logParam,
                            area: "tip"
                    }))
            },
            u.prototype.toggle = function() {
                    s.hasClass(this.el, "hidden") ? this.show(this._logParam) : this.hide(this._logParam)
            },
            u.prototype._dispatchClick = function(e) {
                    var t = e.target || e.srcElement,
                    n = t;
                    while (n && n.nodeName.toLowerCase() !== "a") n = n.parentNode;
                    if (n) {
                            var r = n.getAttribute("data-area");
                            o({
                                    type: "zhishitupulink",
                                    target: [this._logParam, n.getAttribute("title"), n.getAttribute("href")].join(","),
                                    area: "tip-" + r
                            })
                    }
            },
            u.prototype.getDirection = function() {
                    return this._direction
            },
            n.inherits(u, t),
            u
    }), 
    r("zrender/tool/http", ["require"], function(e) {
            function t(e, t, n, r) {
                    if (typeof e == "object") {
                            var i = e;
                            e = i.url,
                            t = i.onsuccess,
                            n = i.onerror,
                            r = i
                    } else typeof n == "object" && (r = n);
                    var s = window.XMLHttpRequest ? new XMLHttpRequest: new ActiveXObject("Microsoft.XMLHTTP");
                    s.open("GET", e, !0),
                    s.onreadystatechange = function() {
                            s.readyState == 4 && (s.status >= 200 && s.status < 300 || s.status === 304 ? t && t(s.responseText) : n && n(), s.onreadystatechange = new Function, s = null)
                    },
                    s.send(null)
            }
            return {
                    get: t
            }
    }), 
    
    /*yyh 页面加载*/
    r("bkgraph/bkgraph", ["require", "zrender/Layer","zrender/config","zrender/Painter","./component/GraphMain", "./component/SideBar", "./component/Loading", "./component/Tip", "etpl", "./util/util", "./util/log", "zrender/tool/http"],
    function(e) {
        function g(e, n) {
                d({
                    type: "zhishitupuopen"
                })
                //$("#"+e)[0].innerHTML = "";/*重新查询数据的时候使用*/
                if(typeof e == "string"){
                	e = document.getElementById(e)
                }
                var r = new m(e, n);
                return r
        }
        var t = e("./component/GraphMain"),
        s = e("./component/SideBar"),
        a = e("./component/Loading"),
        l = e("./component/Tip"),
        c = e("etpl"),
        p = e("./util/util"),
        d = e("./util/log"),
        Z = e("zrender/Painter"),
        y = e("zrender/config"),
        x = e("zrender/Layer"),
        v = e("zrender/tool/http");
        c.addFilter("truncate", p.truncate),
        c.addFilter("trim", p.trim);
        var m = function(e, n) {
                this._container = e,
                this._components = [],
                this._width = 0,
                this._height = 0,
                this._root = document.createElement("div"),
                this._root.className = "bkg-viewport",
                this._root.style.position = "relative",
                this._root.style.overflow = "hidden",
                this._container.appendChild(this._root),
                this.resize();
                var i = new a;
                this.addComponent(i);
                var s = this;
                d({
                    type: "zhishitupuapistart"
                });
                if (!e) {
                    s.removeComponent(i);
                    return
                }
                $.ajax({
                 	url : 'assets/js/json1.txt',
             		data : 'jsonString', 
             		type : "POST",
             		success : function(jsonString){
             			e = eval("("+jsonString+")");
             			e = s._fixData(e),
         				s._rawData = e,
                        s.initialize(e);
                        if(n){
                        	n(s)
                        }
             		},error:function(jsonString){
             	        alert('服务器异常！');
             		}
            	})
        };
        /*yyh加载json数据*/
        m.prototype._fixData = function(e) {
 			if (!e.entities || !e.relations) return;
            for (var t = 0; t < e.entities.length; t++) {
                    var n = e.entities[t];
                    n.layerCounter = n.layerCounter || 0,
                    n.layerCounter = parseInt(n.layerCounter);
                    if(n.layerCounter === 0){
                    	e.mainEntity = n
                    }
            }
            //var r = {};
            for (var i = 0; i < e.relations.length; i++) {
                    var s = e.relations[i];
                    //s.isExtra && (r[s.fromID] || (r[s.fromID] = []), r[s.toID] || (r[s.toID] = []), r[s.fromID].length >= 2 || r[s.toID].length >= 2 ? e.relations.splice(i--, 1) : (r[s.fromID].push(s.id), r[s.toID].push(s.id)))
            }
            return e
        },
        m.prototype.getRawData = function() {
                return this._rawData
        },
        m.prototype.initialize = function(e) {
                var n = this.getComponentByType("loading");
                n && this.removeComponent(n);
                var r = new t;//关键代码
                this.addComponent(r);
                var i = new l;
                this.addComponent(i);
                var s = p.getURLSearch();
                if(e){
                	if(s.relation){
                		r.enableEntryAnimation = !1
                	}
                	r.setData(e,"")//关键方法
                }
                var o = [],
                u = e.mainEntity;
                /*判断当人物只有一个，没有人物关系的时候只画一个人物的Bug yyh*/
                if(e.relations.length==0){
                	o.push({
                		id: u.id
                	});
                }else{
                	for (var a = 0,f = e.relations.length; a < f; a++) {
                    	if(e.relations[a].fromID == u.id){
                    		o.push(e.relations[a]);
                    	}
                    }
                }
                o.sort(function(e, t) {
                	return t.relationWeight - e.relationWeight
                });
                if(s.relation){
                	setTimeout(function() {
                        r.activeEdge(s.relation),
                        r.moveToRelation(s.relation),
                        r.showRelationDetail(s.relation, !0)
                	})
                }else{
                	if(s.entity){
                		setTimeout(function() {
                            r.activeNode(s.entity),
                            r.moveToEntity(s.entity),
                            r.showEntityDetail(s.entity, !0)
                        })
                	}else{
                		setTimeout(function() {
                            r.showEntityDetail(e.mainEntity, !1),
                            r.showEdgeClickTip(o[0].id)
                		})
                    }
                }
                /*放大事件*/
                $("#zoomIn").click(function(){
                	r.zoomIn();
                })
                /*缩小事件*/
                $("#zoomOut").click(function(){
                	r.zoomOut();
                })
        },
        m.prototype.addComponent = function(e) {
                this._components.push(e),
                e.el && e.el.nodeType === 1 && this._root.appendChild(e.el),
                e.initialize(this, this._rawData)
        },
        m.prototype.removeComponent = function(e) {
                this._components.splice(p.indexOf(this._components, e), 1),
                e.el && e.el.nodeType === 1 && this._root.removeChild(e.el),
                e.dispose()
        },
        m.prototype.getComponentsAllByType = function(e) {
                var t = [];
                for (var n = 0; n < this._components.length; n++) this._components[n].type.toUpperCase() === e.toUpperCase() && t.push(this._components[n]);
                return t
        },
        m.prototype.getComponentByType = function(e) {
                for (var t = 0; t < this._components.length; t++) if (this._components[t].type.toUpperCase() === e.toUpperCase()) return this._components[t];
                return null
        },
        m.prototype.resize = function() {
                var e = this._container,
                t = e.currentStyle || window.getComputedStyle(e);
                this._width = e.clientWidth || parseInt(t.width),
                this._height = e.clientHeight || parseInt(t.height),
                this._root.style.width = this._width + "px",
                this._root.style.height = this._height + "px";
                for (var n = 0; n < this._components.length; n++) this._components[n].resize(this._width, this._height)
        },
        m.prototype.getWidth = function() {
                return this._width
        },
        m.prototype.getHeight = function() {
                return this._height
        },
        m.prototype.getRoot = function() {
                return this._root
        };
        var y = {
                SearchBar: i,
                SideBar: s,
                Painter:Z,
                config:y,
                Layer: x,
                init: g    //bkgraph.init
        };
        return y
    }),
    
    r("bkgraph", ["bkgraph/bkgraph"],function(e) {
        return e;
    });
        
    var i = n("bkgraph");
    for (var s in i) {
    	e[s] = i[s];
    }
});
